#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 4e5 + 11;
int N, M;
set<int> s;
int main() {
  cin >> N;
  int ans = 1, mi = -INF, mx = INF, res = 1;
  char op[10];
  int pc;
  for (int i = 1; i <= N; i++) {
    scanf("%s%d", op, &pc);
    if (!ans) continue;
    if (op[1] == 'D') {
      s.insert(pc);
      if (pc >= mi && pc <= mx) res++;
    } else {
      if (pc < mi || pc > mx)
        ans = 0;
      else if (pc == mi || pc == mx)
        ;
      else
        ans = 2LL * ans % MOD;
      s.erase(pc);
      res = 1;
      auto it = s.lower_bound(pc);
      if (it != s.end())
        mx = *it;
      else
        mx = INF;
      if (it != s.begin())
        mi = *(--it);
      else
        mi = -INF;
    }
  }
  ans = (1LL * ans * res) % MOD;
  printf("%d\n", ans);
  return 0;
}
