#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 400005, MOD = 1e9 + 7;
struct ii {
  long long a, b;
  bool operator<(ii o) const { return tie(a, b) < tie(o.a, o.b); }
};
int N;
long long ans;
vector<long long> unk;
set<ii> wait;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  ans = 1;
  long long buy = 0, sell = INF;
  for (int i = 0; i < N; i++) {
    string op;
    int x;
    cin >> op >> x;
    if (op == "ADD") {
      if (buy < x && x < sell) {
        unk.push_back(x);
      } else if (x < buy) {
        wait.insert({x, 0});
      } else if (sell < x) {
        wait.insert({x, 1});
      }
    } else {
      if (x < buy || x > sell) {
        cout << 0 << "\n";
        return 0;
      }
      if (x == buy) {
        auto f = wait.lower_bound({x, 0});
        buy = f == wait.begin() ? 0 : prev(f)->a;
        wait.erase(f);
      } else if (x == sell) {
        auto f = wait.lower_bound({x, 1});
        sell = next(f) == wait.end() ? INF : next(f)->a;
        wait.erase(f);
      } else
        ans = 2 * ans % MOD;
      for (auto u : unk) {
        if (u < x)
          wait.insert({u, 0}), buy = max(buy, u);
        else if (u > x)
          wait.insert({u, 1}), sell = min(sell, u);
      }
      unk.clear();
    }
  }
  ans = ans * (unk.size() + 1) % MOD;
  cout << ans << "\n";
  return 0;
}
