#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int n, p, lcu, mhav, final = 1, mony = 1e9;
set<int> tim;
string seco;
void doit1();
void doit2();
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> seco >> p;
    if (seco == "ADD") {
      doit1();
    } else {
      doit2();
    }
  }
  final = final * (lcu + 1LL) % M;
  cout << final << endl;
  return 0;
}
void doit1() {
  tim.insert(p);
  if (mhav < p && p < mony) ++lcu;
  return;
}
void doit2() {
  if (mhav < p && p < mony) final = final * 2 % M;
  if (p < mhav || mony < p) {
    cout << 0 << endl;
    exit(0);
  }
  set<int>::iterator it = tim.lower_bound(p);
  if (it == tim.begin()) {
    mhav = 0;
  } else {
    mhav = *--it, ++it;
  }
  if (++it == tim.end()) {
    mony = 1e9;
  } else {
    mony = *it;
  }
  tim.erase(--it);
  lcu = 0;
  return;
}
