#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  set<long long> s;
  long long up = 10000000000000000;
  long long down = -10000000000000000;
  long long tot = 0;
  long long ans = 1;
  for (long long i = 0; i < n; ++i) {
    string str;
    long long x;
    cin >> str >> x;
    if (str.length() == 3) {
      if (x < up && x > down) tot++;
      s.insert(x);
    } else {
      if (x < up && x > down) ans *= 2;
      if (x < down || x > up) ans = 0;
      auto a = s.upper_bound(x);
      if (a == s.end())
        up = 10000000000000000;
      else
        up = *a;
      a = s.lower_bound(x);
      if (a == s.begin())
        down = -10000000000000000;
      else
        down = *(--a);
      s.erase(x);
      tot = 0;
      ans %= mod;
    }
  }
  ans *= (tot + 1);
  ans %= mod;
  cout << ans << endl;
}
