#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> stocks;
  stocks.insert(0);
  stocks.insert(308983067);
  auto first_sell = stocks.end();
  --first_sell;
  auto last_buy = stocks.begin();
  long long ans = 1;
  for (int i = 0; i < n; ++i) {
    string action;
    int x;
    cin >> action >> x;
    if (action == "ADD") {
      stocks.insert(x);
    } else {
      auto deal = stocks.find(x);
      if (deal == first_sell) {
        last_buy = deal;
      } else if (deal == last_buy) {
        first_sell = deal;
      } else if (x < *first_sell && x > *last_buy) {
        first_sell = stocks.find(x);
        last_buy = stocks.find(x);
        ans = (ans * 2) % 1000000007;
      } else
        return cout << 0, 0;
      ++first_sell;
      --last_buy;
      stocks.erase(x);
    }
  }
  long q = distance(last_buy, first_sell);
  ans = (ans * q) % 1000000007;
  cout << ans;
}
