mod = 1000000007 def add(a, b): return (a + b) % mod def sub(a, b): return (a + mod - b) % mod def mul(a, b): return ((a % mod) * (b % mod)) % mod def power(x, y): if y == 0 : return 1 elif y == 1 : return x % mod elif y % 2 == 0 : return power(x, y//2)**2 % mod else : return power(x, y//2)**2 * x % mod def div(a, b): return mul(a, power(b, mod-2)) def solve(): N,M,K=map(int,input().split()) L=[0 for i in range(M)] R=[0 for i in range(M)] for i in range(M): L[i],R[i]=map(int,input().split()) ans=0 # n[from][to] : from階からto階へ行く方法 n=[[0 for j in range(N+1)] for i in range(N+1)] for i in range(M): for f in range(L[i],R[i]+1): for t in range(L[i],R[i]+1): n[f][t] += 1 c=[[0 for i in range(N+1)] for k in range(K+1)] c[0][1]=1 for k in range(1,K+1): for t in range(1,N+1): for f in range(1,N+1): c[k][t] = add(c[k][t],mul(c[k-1][f],n[f][t])) return c[k][N] print(solve())