#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  set<long long> buy, sell, notdecided;
  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    long long p;
    cin >> p;
    if (s == "ADD") {
      if (buy.size() != 0 && *buy.rbegin() >= p) {
        buy.insert(p);
      } else if (sell.size() != 0 && *sell.begin() <= p) {
        sell.insert(p);
      } else {
        notdecided.insert(p);
      }
    } else {
      if (buy.size() != 0 && *buy.rbegin() > p) {
        cout << "0";
        return;
      }
      if (sell.size() != 0 && *sell.begin() < p) {
        cout << "0";
        return;
      }
      if (buy.count(p)) {
        buy.erase(p);
        for (long long i : notdecided) {
          sell.insert(i);
        }
        notdecided.clear();
      } else if (sell.count(p)) {
        sell.erase(p);
        for (long long i : notdecided) {
          buy.insert(i);
        }
        notdecided.clear();
      } else {
        ans = (ans * 2) % 1000000007;
        notdecided.erase(p);
        for (long long x : notdecided) {
          if (x < p) {
            buy.insert(x);
          } else {
            sell.insert(x);
          }
        }
        notdecided.clear();
      }
    }
  }
  ans = (ans * (notdecided.size() + 1)) % 1000000007;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
