#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
char get() {
  char c = getchar();
  while (c != 'C' && c != 'D') c = getchar();
  return c;
}
const int mod = 1e9 + 7;
int n;
set<int> s;
int l = 0, r = 1e9;
int ans, nwans;
int main() {
  n = read();
  ans = 1;
  nwans = 1;
  for (register int i = (int)(1); i <= (int)(n); i++) {
    char c = get();
    int x = read();
    if (c == 'D')
      s.insert(x);
    else {
      set<int>::iterator it = s.find(x);
      if (x > l && x < r) ans = ans * 2 % mod;
      if (s.size() == 1) {
        s.clear();
        ans = ans * 1ll * nwans % mod;
        nwans = 1;
        l = 0;
        r = 1e9;
        continue;
      }
      if (x < l || x > r) {
        puts("0");
        return 0;
      }
      if (it == s.begin())
        l = 0;
      else {
        it--;
        l = *it;
        it++;
      }
      it++;
      if (it != s.end())
        r = *it;
      else
        r = 1e9;
      it--;
      s.erase(it);
    }
  }
  for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
    int nw = *it;
    if (nw > l && nw < r) nwans++;
  }
  ans = ans * 1ll * nwans % mod;
  cout << ans << endl;
  return 0;
}
