#include <bits/stdc++.h>
using namespace std;
const int N = 400100;
const long long mod = 1e9 + 7;
set<int> buy, sell, xxx;
int n, p, t;
char s[14];
long long ans = 1;
void read() {
  scanf("%s %d", s, &p);
  t = (strlen(s) == 6);
}
void imp() {
  printf("0\n");
  exit(0);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    read();
    if (!t) {
      if (buy.size() && *--buy.end() > p)
        buy.insert(p);
      else if (sell.size() && *sell.begin() < p)
        sell.insert(p);
      else
        xxx.insert(p);
    } else {
      if (buy.size() && *--buy.end() == p) {
        buy.erase(p);
        while (xxx.size()) {
          sell.insert(*xxx.begin());
          xxx.erase(xxx.begin());
        }
      } else if (sell.size() && *sell.begin() == p) {
        sell.erase(p);
        while (xxx.size()) {
          buy.insert(*xxx.begin());
          xxx.erase(xxx.begin());
        }
      } else {
        if (xxx.count(p)) {
          while (xxx.size()) {
            int q = *xxx.begin();
            xxx.erase(xxx.begin());
            if (q < p) buy.insert(q);
            if (q > p) sell.insert(q);
          }
          ans *= 2ll;
          ans %= mod;
        } else
          imp();
      }
    }
  }
  ans *= 1ll * (xxx.size() + 1);
  ans %= mod;
  printf("%lld\n", ans);
  return 0;
}
