#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
long long fac[1] = {1}, inv[1] = {1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long mp(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return ret;
}
long long cmb(long long r, long long c) {
  return fac[r] * inv[c] % MOD * inv[r - c] % MOD;
}
set<int> se;
int main() {
  int n;
  scanf("%d", &n);
  int topbuy = 0;
  int botsell = 1e9;
  se.insert(topbuy);
  se.insert(botsell);
  int p;
  long long ans = 1;
  for (int i = 0; i < n; i++) {
    string t;
    cin >> t;
    scanf("%d", &p);
    if (t == "ADD")
      se.insert(p);
    else {
      auto k = se.find(p);
      if (botsell < p || topbuy > p) return !printf("0");
      if (botsell != p && topbuy != p) ans = ans * 2 % MOD;
      botsell = *next(k);
      topbuy = *prev(k);
      se.erase(p);
    }
  }
  auto st = se.begin();
  if (topbuy != -1) st = next(se.find(topbuy));
  int cnt = 0;
  for (auto i = st; i != se.end() && *i != botsell; i++) cnt++;
  printf("%lld", ans * (cnt + 1LL) % MOD);
}
