func_code_string: #include <bits/stdc++.h>   using namespace std;   long long int n;   set<long long int> nos;   long long powmod(long long x, long long y, long long m) {     long long res = 1LL;     while (y) {       if (y & 1) res = (res * x) % m;       x = (x * x) % m;       y /= 2;     }     return res;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> n;     long long int ans = 1;     long long int buyt = 0;     long long int selt = INT64_MAX;     for (long long int i = 1; i <= n; i++) {       string s;       long long int val;       cin >> s >> val;       if (s ==  ADD )         nos.insert(val);       else {         nos.erase(val);         if (buyt < val && selt > val)           ans = (ans * 2) % 1000000007;         else if (buyt == val || selt == val)           ans = (ans * 1) % 1000000007;         else           ans = 0;         auto it = nos.upper_bound(val);         auto it1 = nos.lower_bound(val);         if (it != nos.end())           selt = *it;         else           selt = INT64_MAX;         if (it1 != nos.begin()) {           it1--;           buyt = *it1;         } else {           buyt = 0;         }       }     }     long long int m = 0;     for (auto it = nos.begin(); it != nos.end(); it++) {       long long int temp = *it;       if (temp > buyt && temp < selt) m++;     }     ans = (ans * (m + 1)) % 1000000007;     cout << ans <<   n ;   }   