import sys def MI(): return map(int,sys.stdin.readline().rstrip().split()) N,M,K = MI() LR = [tuple(MI()) for _ in range(M)] mod = 10**9+7 A = [0]*(N+2) SA = [1]*(N+2) SA[0] = 0 for _ in range(K): for i in range(M): L,R = LR[i] x = SA[R]-SA[L-1] A[L] += x A[R+1] -= x SA = [0]*(N+2) for i in range(1,N+2): SA[i] = A[i]+SA[i-1] SA[i] %= mod for i in range(1,N+2): SA[i] += SA[i-1] SA[i] %= mod A = [0]*(N+2) print(SA[N]-SA[N-1])