#include <bits/stdc++.h>
using namespace std;
const int maxm = 400005;
const int mod = 1e9 + 7;
struct S {
  int val;
  bool operator<(const S &r) const { return val > r.val; }
};
struct node {
  char str[10];
  int p;
} a[maxm];
int x[maxm];
set<int> buy, sell, q;
int main() {
  int n, i, j, k, sum, cnt, s;
  long long ans = 1;
  sum = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%s%d", a[i].str, &a[i].p);
  for (i = 1; i <= n; i++) {
    if (a[i].str[1] == 'D') {
      if (!buy.empty() && *buy.rbegin() >= a[i].p)
        buy.insert(a[i].p);
      else if (!sell.empty() && *sell.begin() <= a[i].p)
        sell.insert(a[i].p);
      else
        q.insert(a[i].p);
    } else {
      if (!buy.empty() && *buy.rbegin() > a[i].p) {
        printf("0\n");
        return 0;
      }
      if (!sell.empty() && *sell.begin() < a[i].p) {
        printf("0\n");
        return 0;
      }
      if (buy.count(a[i].p)) {
        buy.erase(a[i].p);
        for (int x : q) sell.insert(x);
        q.clear();
      } else if (sell.count(a[i].p)) {
        sell.erase(a[i].p);
        for (int x : q) buy.insert(x);
        q.clear();
      } else {
        q.erase(a[i].p);
        for (int x : q) {
          if (x < a[i].p)
            buy.insert(x);
          else
            sell.insert(x);
        }
        q.clear();
        ans = ans * 2 % mod;
      }
    }
  }
  ans = (ans * (q.size() + 1)) % mod;
  printf("%lld\n", ans);
  return 0;
}
