import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long MOD = (long)Math.pow(10, 9) + 7; int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt(); int[] L = new int[m]; int[] R = new int[m]; for(int i = 0; i < m; i++) { L[i] = sc.nextInt(); R[i] = sc.nextInt(); } long[][] dp = new long[k + 1][n + 1]; dp[0][1] = 1; for(int i = 1; i < k + 1; i++) { long[] rui = new long[n + 1]; for(int j = 1; j < n + 1; j++) { rui[j] = (rui[j - 1] + dp[i - 1][j]) % MOD; } long[] imos = new long[n + 1]; for(int j = 0; j < m; j++) { long t = (MOD + rui[R[j]] - rui[L[j] - 1]) % MOD; imos[L[j]] = (imos[L[j]] + t) % MOD; imos[R[j] + 1] = (MOD + imos[R[j] + 1] - t) % MOD; } for(int j = 1; j < n + 1; j++) { imos[j] = (imos[j - 1] + imos[j]) % MOD; dp[i][j] = imos[j]; } } System.out.println(dp[k][n]); } }