#include <bits/stdc++.h>
using namespace std;
const int N = (int)4e5 + 100;
const int M = (int)2e6 + 100;
const int K = (int)200;
const int INF = (int)1e9 + 7;
const int mod = (int)998244353;
const long double EPS = (long double)1e-9;
const long long LINF = (long long)1e15;
int n;
pair<string, int> a[N];
set<int> dcba, abcd, maybe;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  int ans = 1;
  for (int i = 1; i <= n; i++) {
    int val = a[i].second;
    if (a[i].first == "ADD") {
      if (!abcd.empty() && val > *abcd.begin()) {
        abcd.insert(val);
      } else if (!dcba.empty() && val < *dcba.rbegin()) {
        dcba.insert(val);
      } else {
        maybe.insert(val);
      }
    } else {
      if (abcd.find(val) != abcd.end()) {
        if (*abcd.begin() != val) {
          cout << 0;
          return 0;
        }
        abcd.erase(val);
        while (!maybe.empty()) {
          int fi = *maybe.begin();
          assert(fi < val);
          maybe.erase(maybe.begin());
          dcba.insert(fi);
        }
      } else if (dcba.find(val) != dcba.end()) {
        if (*dcba.rbegin() != val) {
          cout << 0;
          return 0;
        }
        dcba.erase(val);
        while (!maybe.empty()) {
          int fi = *maybe.begin();
          assert(fi > val);
          maybe.erase(maybe.begin());
          abcd.insert(fi);
        }
      } else {
        while (!maybe.empty()) {
          int fi = *maybe.begin();
          maybe.erase(maybe.begin());
          if (fi > val)
            abcd.insert(fi);
          else if (fi < val)
            dcba.insert(fi);
        }
        ans = (ans * 2LL) % INF;
      }
    }
  }
  ans = (ans * 1ll * (int(maybe.size()) + 1)) % INF;
  cout << ans;
  return 0;
}
