n,m,k=map(int,input().split()) e=[tuple(map(int,input().split())) for i in range(m)] M=10**9+7 q=[0]*(n+1) q[1]=1 for i in range(1,n+1): q[i]+=q[i-1] for _ in range(k): nq=[0]*(n+1) for l,r in e: nq[l]+=q[r]-q[l-1] if r+1<=n: nq[r+1]-=q[r]-q[l-1] for i in range(1,n+1): nq[i]+=nq[i-1] nq[i]%=M for i in range(1,n+1): nq[i]+=nq[i-1] nq[i]%=M q=nq print((q[n]-q[n-1])%M)