n,m,k=map(int,input().split()) dp=[[0 for i in range(3030)]for j in range(3030)] e=[] for i in range(m) : x,y=map(int,input().split()) e.append([x,y]) mod = 1000000007 dp[0][1]=1 for i in range(k): for j in range(n) : dp[i][j+1]+=dp[i][j] dp[i][j+1]%=mod for p in e : dp[i+1][p[0]]+=dp[i][p[1]]-dp[i][p[0]-1] dp[i+1][p[1]+1]-=dp[i][p[1]]-dp[i][p[0]-1] for j in range(n): dp[i+1][j+1]+=dp[i+1][j] dp[i+1][j+1]%=mod print(dp[k][n])