#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < v.size(); i++) os << v[i] << " ";
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  for (typename set<T>::iterator it = v.begin(); it != v.end(); it++)
    os << *it << " ";
}
const double eps = 1e-9;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int sgn(double a) { return a < -eps ? -1 : a < eps ? 0 : 1; }
int gi() {
  int w = 0;
  bool q = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 0, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? w : -w;
}
char s[10];
set<int> un, sell, buy;
int main() {
  int n = gi();
  int ans = 1;
  for (int i = (1); i <= (n); i++) {
    int x;
    scanf("%s%d", s, &x);
    if (s[1] == 'D') {
      if ((int)sell.size() && x > (*sell.begin())) {
        sell.insert(x);
      } else {
        if ((int)buy.size() && x < (*buy.rbegin())) {
          buy.insert(x);
        } else {
          un.insert(x);
        }
      }
    }
    if (s[1] == 'C') {
      if (sell.count(x)) {
        if ((*sell.begin()) < x) {
          puts("0");
          return 0;
        } else {
          sell.erase(x);
          for (int p : un) buy.insert(p);
          un.clear();
          continue;
        }
      } else {
        if (buy.count(x)) {
          if ((*buy.rbegin()) > x) {
            puts("0");
            return 0;
          } else {
            buy.erase(x);
            for (int p : un) sell.insert(p);
            un.clear();
            continue;
          }
        }
      }
      auto p = un.upper_bound(x);
      for (auto it = p; it != un.end(); it++) {
        sell.insert(*it);
      }
      p--;
      for (auto it = un.begin(); it != p; it++) {
        buy.insert(*it);
      }
      ans *= 2;
      if (ans >= mod) ans -= mod;
      un.clear();
    }
  }
  ans = ((int)un.size() + 1) * (long long)ans % mod;
  cout << ans;
  return 0;
}
