#include <bits/stdc++.h>
using namespace std;
const int INF = 4e8;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  set<int> sets;
  set<int>::iterator ite;
  string cmd;
  int q, x, head = 0, tail = INF;
  cin >> q;
  int res = 1, temp = 1;
  sets.insert(0);
  sets.insert(INF);
  while (q--) {
    cin >> cmd >> x;
    if (cmd[1] == 'D') {
      if (x > head && x < tail) ++temp;
      sets.insert(x);
    } else {
      if (x < head || x > tail) {
        res = 0;
        break;
      }
      if (x != head && x != tail) res = (long long)res * 2 % MOD;
      temp = 1;
      ite = sets.find(x);
      --ite;
      head = *ite;
      ++ite;
      ++ite;
      tail = *ite;
      --ite;
      sets.erase(ite);
    }
  }
  res = (long long)res * temp % MOD;
  cout << res;
}
