#include <bits/stdc++.h>
using namespace std;
set<long long> s;
const int mod = 1e9 + 7;
int main() {
  int n, lastlen = 0;
  int res = 1;
  long long l = 0, r = 1e18;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    char c[10];
    long long x;
    scanf(" %s%I64d", c, &x);
    if (strlen(c) == 3) {
      if (x >= l && x <= r) lastlen++;
      s.insert(x);
    } else {
      lastlen = 0;
      set<long long>::iterator it = s.find(x);
      if (!(x >= l && x <= r)) {
        printf("0\n");
        return 0;
      }
      if (x > l && x < r) res = res * 2 % mod;
      if (it != s.begin()) {
        it--;
        l = *it;
        it++;
      } else
        l = 0;
      it++;
      if (it != s.end()) {
        r = *it;
      } else
        r = 1e18;
      it--;
      s.erase(it);
    }
  }
  printf("%d\n", res * 1ll * (lastlen + 1) % mod);
  return 0;
}
