#include <bits/stdc++.h>
using namespace std;
string s;
map<long long, long long> mp;
set<long long> st[2];
long long p, mod = 1000000007, ans = 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, n;
  cin >> n;
  set<long long> st[2];
  for (i = 0; i < n; i++) {
    cin >> s >> p;
    if (s[2] == 'D') {
      st[0].insert(p);
      st[1].insert(p);
      mp[p] = 3;
    } else {
      auto it = mp.find(p);
      if (it == mp.end()) {
        cout << 0 << endl;
        return 0;
      }
      while (st[0].size() && *st[0].begin() < p) {
        long long x = *st[0].begin();
        mp[x] &= 1;
        st[0].erase(x);
      }
      while (st[1].size() && *st[1].rbegin() > p) {
        long long x = *st[1].rbegin();
        mp[x] &= 2;
        st[1].erase(x);
      }
      if (mp[p] == 3) (ans *= 2) %= mod;
      st[0].erase(p);
      st[1].erase(p);
      mp.erase(p);
    }
  }
  vector<int> v;
  for (auto x : mp) v.push_back(x.second);
  for (i = 1; i < v.size(); i++) {
    if ((v[i - 1] & 1) == 0) v[i] &= 2;
  }
  for (i = (int)v.size() - 2; i >= 0; i--) {
    if ((v[i + 1] & 2) == 0) v[i] &= 1;
  }
  long long num = 0;
  for (i = 0; i < v.size(); i++) {
    if (v[i] == 0) ans = 0;
    if (v[i] == 3) num++;
  }
  ans = ans * (num + 1) % mod;
  cout << ans << endl;
}
