#include <bits/stdc++.h>
const long long MOD = 1000000007;
const int INF = 0x7fffffff;
using namespace std;
set<int> Num;
int n;
int main() {
  Num.clear();
  Num.insert(0);
  Num.insert(INF);
  int l = 0, r = INF;
  set<int>::iterator pos;
  scanf("%d", &n);
  long long Ans = 1ll;
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    char str[10];
    int x, len;
    scanf("%s%d", str, &x);
    len = strlen(str);
    if (len == 3) {
      Num.insert(x);
      if (l < x && x < r) flag++;
    } else if (len == 6) {
      flag = 0;
      if (x < l || x > r) {
        Ans = 0ll;
        break;
      } else if (x == l || x == r) {
        pos = Num.find(x);
        pos++;
        r = (*pos);
        pos--;
        pos--;
        l = (*pos);
        pos++;
        Num.erase(x);
      } else {
        if (Num.find(x) == Num.end()) {
          Ans = 0ll;
          break;
        }
        Ans = (Ans * 2ll) % MOD;
        pos = Num.find(x);
        pos++;
        r = (*pos);
        pos--;
        pos--;
        l = (*pos);
        pos++;
        Num.erase(x);
      }
    }
  }
  if (flag != 0) Ans = (Ans * (long long)(flag + 1ll)) % MOD;
  printf("%lld", Ans);
  return 0;
}
