#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5, MOD = 1e9 + 7;
template <typename T>
void chkmax(T& x, T y) {
  if (y > x) x = y;
}
template <typename T>
void chkmin(T& x, T y) {
  if (y < x) x = y;
}
int N, ans = 1;
set<int> S, buy, sell;
int main() {
  scanf("%d", &N);
  char str[10];
  int x;
  while (N--) {
    scanf("%s%d", str, &x);
    if (str[1] == 'D') {
      if ((buy.empty() || x > *(--buy.end())) &&
          (sell.empty() || x < *(sell.begin())))
        S.insert(x);
      else if (!buy.empty() && x < *(--buy.end()))
        buy.insert(x);
      else
        sell.insert(x);
    } else {
      if (S.find(x) != S.end()) {
        ans = ans * 2 % MOD, S.erase(x);
        for (set<int>::iterator it = S.begin(); it != S.end(); ++it) {
          if ((*it) < x)
            buy.insert(*it);
          else
            sell.insert(*it);
        }
        S.clear();
      } else if (buy.find(x) != buy.end()) {
        if (x != *(--buy.end())) {
          puts("0");
          return 0;
        }
        buy.erase(--buy.end());
        for (set<int>::iterator it = S.begin(); it != S.end(); ++it) {
          sell.insert(*it);
        }
        S.clear();
      } else {
        if (x != *(sell.begin())) {
          puts("0");
          return 0;
        }
        sell.erase(sell.begin());
        for (set<int>::iterator it = S.begin(); it != S.end(); ++it) {
          buy.insert(*it);
        }
        S.clear();
      }
    }
  }
  ans = 1ll * ans * (S.size() + 1) % MOD;
  printf("%d", ans);
  return 0;
}
