#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  set<int> buy, sell;
  vector<int> rem;
  long long res = 1;
  while (n--) {
    string s;
    int p;
    cin >> s >> p;
    if (s[1] == 'D') {
      int B = -1;
      if (buy.size()) B = *buy.rbegin();
      int second = 1e9;
      if (sell.size()) second = *sell.begin();
      if (p == B || p == second) {
        cout << 0 << endl;
        return 0;
      }
      if (p < B)
        buy.insert(p);
      else if (p > second)
        sell.insert(p);
      else
        rem.push_back(p);
    } else {
      bool ers = 0;
      if (buy.find(p) != buy.end()) {
        if (*buy.rbegin() != p) {
          cout << 0 << endl;
          return 0;
        }
        buy.erase(p);
        ers = 1;
      }
      if (sell.find(p) != sell.end()) {
        if (*sell.begin() != p) {
          cout << 0 << endl;
          return 0;
        }
        sell.erase(p);
        ers = 1;
      }
      if (!ers) res *= 2;
      res %= mod;
      bool ok = ers;
      for (auto x : rem) {
        if (x == p)
          ok = 1;
        else if (x < p)
          buy.insert(x);
        else
          sell.insert(x);
      }
      if (!ok) {
        cout << 0 << endl;
        return 0;
      }
      rem.clear();
    }
  }
  res = (res * (long long)(1 + rem.size())) % mod;
  cout << res << endl;
  return 0;
}
