func_code_string: #include <bits/stdc++.h>   using namespace std;   struct Bus {     long long s, t;   };   bool cmp(Bus &a, Bus &b) { return a.t < b.t; }   long long n, m, it[4 * 111111], tmp = 1, l, r;   Bus bus[111111];   vector<long long> positions;   void update(int idx, int l, int r, int pos, long long val) {     if (pos < l || pos > r) return;     if (l == r) {       it[idx] = val;       return;     }     int m = (l + r) / 2;     update(2 * idx, l, m, pos, val);     update(2 * idx + 1, m + 1, r, pos, val);     it[idx] = (it[2 * idx] + it[2 * idx + 1]) % 1000000007;   }   long long get(int idx, int l, int r, int u, int v) {     if (v < l || r < u) return 0;     if (u <= l && r <= v) return it[idx];     int m = (l + r) / 2;     long long ret =         (get(2 * idx, l, m, u, v) + get(2 * idx + 1, m + 1, r, u, v)) %         1000000007;     return ret;   }   int main() {     cin >> n >> m;     for (int i = 0; i < m; i++) cin >> bus[i].s >> bus[i].t;     sort(bus, bus + m, cmp);     positions.push_back(0);     for (int i = 0; i < m; i++)       if (bus[i].t != positions[positions.size() - 1])         positions.push_back(bus[i].t);     if (n != positions[positions.size() - 1]) positions.push_back(n);     update(1, 0, positions.size() - 1, 0, 1);     for (int i = 0; i < m; i++) {       l = lower_bound(positions.begin(), positions.end(), bus[i].s) -           positions.begin();       r = upper_bound(positions.begin(), positions.end(), bus[i].t) -           positions.begin() - 1;       tmp = get(1, 0, positions.size() - 1, l, r);       update(1, 0, positions.size() - 1, r, tmp);     }     cout << get(1, 0, positions.size() - 1, positions.size() - 1,                 positions.size() - 1);   }   