import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt(); int[] lefts = new int[m]; int[] rights = new int[m]; for (int i = 0; i < m; i++) { lefts[i] = sc.nextInt(); rights[i] = sc.nextInt(); } int[][] dp = new int[k + 1][n + 2]; Arrays.fill(dp[0], 1); dp[0][0] = 0; for (int i = 1; i <= k; i++) { for (int j = 0; j < m; j++) { int sum = (dp[i - 1][rights[j]] - dp[i - 1][lefts[j] - 1] + MOD) % MOD; dp[i][lefts[j]] += sum; dp[i][lefts[j]] %= MOD; dp[i][rights[j] + 1] += MOD - sum; dp[i][rights[j] + 1] %= MOD; } for (int j = 1; j <= n; j++) { dp[i][j] += dp[i][j - 1]; dp[i][j] %= MOD; } for (int j = 1; j <= n; j++) { dp[i][j] += dp[i][j - 1]; dp[i][j] %= MOD; } } System.out.println((dp[k][n] - dp[k][n - 1] + MOD) % MOD); } }