#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  long long ans = 1;
  set<int> buy = {-INT_MAX}, sell = {INT_MAX};
  vector<int> open;
  for (int i = 0; i < n; i++) {
    string op;
    int p;
    cin >> op >> p;
    if (op == "ADD") {
      if (p > *sell.begin())
        sell.insert(p);
      else if (p < *buy.rbegin())
        buy.insert(p);
      else
        open.push_back(p);
    } else {
      if (buy.count(p) == 0 && sell.count(p) == 0)
        ans = ans * 2 % mod;
      else
        buy.erase(p), sell.erase(p);
      if (*sell.begin() < p || *buy.rbegin() > p) printf("0\n"), exit(0);
      for (int x : open)
        if (x > p)
          sell.insert(x);
        else if (x < p)
          buy.insert(x);
      open.clear();
    }
  }
  printf("%lld\n", ans * (open.size() + 1) % mod);
}
