#yuki801 import itertools mod=10**9+7 n,m,k=map(int,input().split()) lr=[] for i in range(m): lr.append(list(map(int,input().split()))) dp=[0]*(n+1) dp[1]=1 for i in range(k): t=[0]*(n+2) da=list(itertools.accumulate(dp)) for l,r in lr: t[l]+=da[r]-da[l-1] t[r+1]-=da[r]-da[l-1] dp=list(map(lambda x:x%mod,itertools.accumulate(t))) print(dp[-2])