#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  long long ans = 1;
  int n;
  cin >> n;
  set<int> buy;
  set<int> sell;
  set<int> unknown;
  for (int i = 0; i < n; ++i) {
    string line;
    int var;
    cin >> line >> var;
    if (line == "ADD") {
      if (buy.size() > 0 && *buy.rbegin() > var) {
        buy.insert(var);
      } else {
        if (sell.size() > 0 && *sell.begin() < var) {
          sell.insert(var);
        } else {
          unknown.insert(var);
        }
      }
    } else {
      auto it = buy.find(var);
      if (buy.size() > 0 && it != buy.end()) {
        if (*buy.rbegin() == var) {
          buy.erase(it);
          for (auto it : unknown) {
            sell.insert(it);
          }
          unknown.clear();
        } else {
          cout << 0 << "\n";
          return 0;
        }
      } else {
        it = sell.find(var);
        if (sell.size() > 0 && it != sell.end()) {
          if (*sell.begin() == var) {
            sell.erase(it);
            for (auto it : unknown) {
              buy.insert(it);
            }
            unknown.clear();
          } else {
            cout << 0 << "\n";
            return 0;
          }
        } else {
          for (auto it : unknown) {
            if (it < var) {
              buy.insert(it);
            }
            if (it > var) {
              sell.insert(it);
            }
          }
          unknown.clear();
          ans *= 2;
          ans %= MOD;
        }
      }
    }
  }
  ans *= (unknown.size() + 1);
  ans %= MOD;
  cout << ans << "\n";
  return 0;
}
