import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") import copy def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, M, K = getlist() ele = [] for i in range(M): L, R = getlist() L -= 1; R -= 1 ele.append([L, R]) DP = [[0] * (N + 1) for i in range(K + 1)] 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] %= con imos = [0] * (N + 1) for j in range(M): l, r = ele[j] val = DP[i][r + 1] - DP[i][l] imos[l] += val; imos[r + 1] -= val for j in range(N): imos[j + 1] += imos[j] imos[j + 1] %= con for j in range(N): DP[i + 1][j + 1] = imos[j] ans = DP[-1][-1] print(ans % con) if __name__ == '__main__': main()