#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
int N;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  set<int> vals = {0, (int)1e9};
  cin >> N;
  int poss = 1, cnt = 0, p, buy, sell;
  string act;
  long long int ans = 1;
  buy = 0, sell = 1e9;
  while (N--) {
    cin >> act >> p;
    if (!poss) continue;
    if (act == "ADD") {
      vals.insert(p);
      if (p > buy && p < sell) ++cnt;
    } else {
      auto it = vals.find(p);
      cnt = 0;
      if (p < buy || p > sell) {
        poss = false;
        continue;
      }
      if (p > buy && p < sell) ans = ans * 2 % MOD;
      vals.erase(it);
      it = vals.lower_bound(p);
      sell = *it;
      buy = *(--it);
    }
  }
  ans = ans * (cnt + 1) % MOD;
  if (!poss)
    cout << "0\n";
  else
    cout << ans << '\n';
}
