#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const double eps = 1e-12;
template <typename T>
inline void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const int N = 400010;
const long long P = 1e9 + 7;
int n;
set<int> unk;
set<int>::iterator it, ii;
priority_queue<int, vector<int>, greater<int> > lar;
int rbd;
priority_queue<int, vector<int>, less<int> > sma;
int lbd;
char s[100];
long long ans = 1;
inline long long Pow(long long x, long long y) {
  long long ret = 1;
  for (; y; y >>= 1, x = x * x % P)
    if (y & 1) ret = ret * x % P;
  return ret;
}
signed main() {
  read(n);
  lbd = -1;
  rbd = INF;
  lar.push(INF);
  sma.push(-1);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%s%d", s + 1, &x);
    if (s[2] == 'D') {
      if (x > rbd)
        lar.push(x);
      else if (x < lbd)
        sma.push(x);
      else
        unk.insert(x);
    } else if (s[2] == 'C') {
      if (rbd == x) {
        lar.pop();
        rbd = lar.top();
        for (ii = unk.begin(); ii != unk.end(); ii++) sma.push(*ii);
        lbd = sma.top();
      } else if (lbd == x) {
        sma.pop();
        lbd = sma.top();
        for (ii = unk.begin(); ii != unk.end(); ii++) lar.push(*ii);
        rbd = lar.top();
      } else {
        ans = ans * 2 % P;
        it = unk.find(x);
        if (it == unk.end()) {
          assert(x < lbd || x > rbd);
          puts("0");
          return 0;
        }
        for (ii = unk.begin(); ii != it; ii++) {
          sma.push(*ii);
        }
        lbd = sma.top();
        for (ii = (++it); ii != unk.end(); ii++) {
          lar.push(*ii);
        }
        rbd = lar.top();
      }
      unk.clear();
    }
  }
  ans = ans * (unk.size() + 1) % P;
  printf("%lld\n", ans);
  return 0;
}
