#include <bits/stdc++.h>
const int MAXN = 4e5 + 5;
const int MOD = 1e9 + 7;
std::set<int> beg, end, two;
char s[MAXN];
int n, p, ret = 1;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf(" %s%d", s, &p);
    if (!ret) continue;
    switch (s[1]) {
      case 'C':
        if (two.count(p)) {
          auto ktr = two.lower_bound(p);
          for (auto itr = two.begin(); itr != ktr;) {
            beg.insert(*itr);
            itr = two.erase(itr);
          }
          auto jtr = two.lower_bound(p);
          ++jtr;
          while (jtr != two.end()) {
            end.insert(*jtr);
            jtr = two.erase(jtr);
          }
          two.erase(p);
          ret = 2LL * ret % MOD;
        } else if (beg.count(p)) {
          if (p != *beg.rbegin())
            ret = 0;
          else {
            beg.erase(p);
            for (int off : two) end.insert(off);
            two.clear();
          }
        } else {
          if (p != *end.begin())
            ret = 0;
          else {
            end.erase(p);
            for (int off : two) beg.insert(off);
            two.clear();
          }
        }
        break;
      case 'D':
        if (beg.empty() && end.empty())
          two.insert(p);
        else if (beg.empty()) {
          if (p < *end.begin())
            two.insert(p);
          else
            end.insert(p);
        } else if (end.empty()) {
          if (p > *beg.rbegin())
            two.insert(p);
          else
            beg.insert(p);
        } else {
          if (p <= *beg.rbegin())
            beg.insert(p);
          else if (p >= *end.begin())
            end.insert(p);
          else
            two.insert(p);
        }
        break;
    }
  }
  ret = 1LL * ret * (two.size() + 1LL) % MOD;
  printf("%d\n", ret);
  return 0;
}
