#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
set<int> sell, buy;
vector<int> order;
int n, p, sell_min, buy_max;
char op[10];
long long ans = 1;
bool over = false;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n && !over; ++i) {
    scanf("%s%d", op, &p);
    sell_min = sell.empty() ? 308983070 : *sell.begin();
    buy_max = buy.empty() ? 0 : *(--buy.end());
    if (op[1] == 'D') {
      if (p >= sell_min) sell.insert(p);
      if (p <= buy_max) buy.insert(p);
      if (p > buy_max && p < sell_min) order.push_back(p);
    } else {
      if (p < buy_max || p > sell_min) {
        over = true;
        continue;
      }
      if (p == buy_max) {
        buy.erase(p);
        for (int j = 0; j < order.size(); ++j) sell.insert(order[j]);
        order.clear();
        continue;
      }
      if (p == sell_min) {
        sell.erase(p);
        for (int j = 0; j < order.size(); ++j) buy.insert(order[j]);
        order.clear();
        continue;
      }
      bool find = false;
      for (int j = 0; j < order.size(); ++j) {
        if (order[j] == p) find = true;
        if (order[j] > p) sell.insert(order[j]);
        if (order[j] < p) buy.insert(order[j]);
      }
      if (!find) {
        over = true;
        continue;
      }
      order.clear();
      ans = ans * 2 % mod;
    }
  }
  if (over)
    ans = 0;
  else
    ans = ans * (order.size() + 1) % mod;
  printf("%lld\n", ans);
  return 0;
}
