#include #define rep(i,n) for(int i=0;i ; using pll = pair; constexpr int INF = 1e9; constexpr ll LINF = 1e18; constexpr int MOD = 1000000007; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n,m,k; cin >> n >> m >> k; vector

lr(m); rep(i,m){ cin >> lr[i].first >> lr[i].second; } vector a_prev(n+2,1); a_prev[0] = 0; vector a(n+2,0); rep(i,k){ rep(j,m){ int l = lr[j].first; int r = lr[j].second; ll plus = a_prev[r] - a_prev[l-1]; a[l] = (a[l] + plus)%MOD; a[r+1] = (a[r+1] - plus + MOD)%MOD; } rep(c,2){ for(int j=1;j empty(n+2,0); swap(empty,a); } cout << (a_prev[n] - a_prev[n-1] + MOD)%MOD << endl; return 0; }