#include <bits/stdc++.h>
using namespace std;
const long long N = 365000, LOG = 17;
const int MOD = 1000000007;
int n, p, cnt = 0, dp[N][2];
pair<int, int> of[N];
char s[10];
int calc(int X) {
  if (X == 0) return 1;
  dp[X][0] = 2;
  dp[X][1] = 1;
  for (int i = (int)X - 1; i >= (int)1; i--) {
    dp[i][0] = (dp[i + 1][1] + dp[i + 1][0]) % MOD;
    dp[i][1] = dp[i + 1][1];
  }
  return dp[1][0];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf(" %s%d", s, &p);
    if (s[1] == 'D')
      of[i] = make_pair(1, p);
    else
      of[i] = make_pair(2, p);
  }
  priority_queue<int> buy, sell;
  set<int> s;
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    if (of[i].first == 1) {
      if (sell.size() && of[i].second > -sell.top()) {
        sell.push(-of[i].second);
      } else if (buy.size() && of[i].second < buy.top()) {
        buy.push(of[i].second);
      } else {
        s.insert(of[i].second);
      }
    } else {
      if (s.find(of[i].second) == s.end() &&
          (buy.empty() || buy.top() != of[i].second) &&
          (sell.empty() || sell.top() != -of[i].second)) {
        puts("0");
        return 0;
      }
      bool flag = false;
      if (buy.size() && buy.top() == of[i].second) {
        buy.pop();
        flag = true;
      }
      if (sell.size() && sell.top() == -of[i].second) {
        sell.pop();
        flag = true;
      }
      while (s.size()) {
        int val = (*s.begin());
        s.erase(s.begin());
        if (val < of[i].second) {
          if (sell.size() && val > -sell.top()) {
            puts("0");
            return 0;
          }
          buy.push(val);
        } else if (val > of[i].second) {
          if (buy.size() && val < buy.top()) {
            puts("0");
            return 0;
          }
          sell.push(-val);
        }
      }
      if (!flag) ans = (ans * 2) % MOD;
    }
  }
  vector<int> v;
  while (s.size()) {
    int val = (*s.begin());
    s.erase(s.begin());
    if (sell.size() && val > -sell.top()) {
      continue;
    }
    if (buy.size() && val < buy.top()) {
      continue;
    }
    v.push_back(val);
  }
  ans = (ans * calc((int)v.size())) % MOD;
  cout << ans;
  return 0;
}
