#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 5;
const int inf = 308983066 + 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long res = 1;
  set<int> book;
  int maxbuy = 0;
  int minsell = inf;
  book.insert(maxbuy);
  book.insert(minsell);
  while (n--) {
    string op;
    int x;
    cin >> op >> x;
    if (op == "ACCEPT") {
      if (x < maxbuy || x > minsell) out(0);
      if (maxbuy < x && x < minsell) res = res * 2LL % mod;
      auto iter = book.find(x);
      maxbuy = *prev(iter);
      minsell = *next(iter);
      book.erase(iter);
    } else {
      book.insert(x);
    }
  }
  while (!book.empty() && *book.begin() <= maxbuy) book.erase(book.begin());
  while (!book.empty() && *book.rbegin() >= minsell) book.erase(--book.end());
  long long rem = book.size();
  res = res * (rem + 1) % mod;
  out(res);
  return 0;
}
