import sys input = sys.stdin.readline N, M, K = map(int, input().split()) LR = [tuple(map(int, input().split())) for _ in range(M)] dp = [0]*N dp[0] = 1 MOD = 10**9+7 for _ in range(K): acc = [0] for dpi in dp: acc.append((acc[-1]+dpi)%MOD) imos = [0]*(N+1) for L, R in LR: imos[L-1] += acc[R]-acc[L-1] imos[R] -= acc[R]-acc[L-1] for i in range(1, N+1): imos[i] += imos[i-1] imos[i] %= MOD dp = imos[:-1] print(dp[-1])