from collections import * from functools import * from itertools import * from heapq import * import sys,math input = sys.stdin.readline N,M,K = map(int,input().split()) mod = 10**9 + 7 LR = [tuple(map(int,input().split())) for _ in range(M)] dp = [[0]*(N+1) for _ in range(K+1)] dp[0][1] = 1 for i in range(K): I = [0]*(N+2) S = list(accumulate([0]+dp[i])) for l,r in LR: ds = S[r+1]-S[l] I[l] += ds I[r+1] -= ds I = list(accumulate(I)) dp[i+1] = [i%mod for i in I[:N+1]] print(dp[-1][N])