func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 500;   const int M = 1e6 + 500;   const int INF = 0x3f3f3f3f;   const int MOD = 1e9 + 7;   const int LOG = 20;   const int OFF = (1 << 20);   const double EPS = 1e-9;   const double PI = 3.1415926535;   set<int> st;   int n, x, l, r;   char s[10];   long long sol = 1;   int main() {     st.insert(-INF);     st.insert(INF);     sol = 1;     l = -INF;     r = INF;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %s , s);       scanf( %d , &x);       if (s[1] ==  D ) {         st.insert(x);       } else {         st.erase(x);         if (l <= x && x <= r) {           if (x != l && x != r) sol = (2LL * sol) % (long long)MOD;           l = *(--st.upper_bound(x));           r = *st.upper_bound(x);         } else {           sol = 0;         }       }     }     int cnt = 0;     for (int x : st) {       if (l <= x && x <= r) cnt++;     }     sol = (sol * (cnt - 1)) % (long long)MOD;     printf( %d n , (int)sol);     return 0;   }   