#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0);
int n;
char buf[10];
set<int> lhs;
set<int> rhs;
long long ret;
vector<int> unknown;
void update(int idx) {
  if (!rhs.empty() && idx >= *rhs.begin()) {
    rhs.insert(idx);
    return;
  }
  if (!lhs.empty() && idx <= *lhs.rbegin()) {
    lhs.insert(idx);
    return;
  }
  unknown.push_back(idx);
}
void query(int idx) {
  if (!rhs.empty() && idx > *rhs.begin()) {
    printf("0\n");
    exit(0);
  }
  if (!lhs.empty() && idx < *lhs.rbegin()) {
    printf("0\n");
    exit(0);
  }
  if (rhs.count(idx)) {
    rhs.erase(idx);
  } else if (lhs.count(idx)) {
    lhs.erase(idx);
  } else {
    ret *= 2;
    ret %= 1000000007;
  }
  for (int out : unknown) {
    if (out > idx) {
      rhs.insert(out);
    } else if (out < idx) {
      lhs.insert(out);
    }
  }
  unknown.clear();
}
int main() {
  scanf("%d\n", &n);
  ret = 1;
  while (n--) {
    int idx;
    scanf("%s%d\n", buf, &idx);
    if (strlen(buf) == 3) {
      update(idx);
    } else {
      query(idx);
    }
  }
  long long scale = 1;
  for (int out : unknown) {
    if (!rhs.empty() && out > *rhs.begin()) continue;
    if (!lhs.empty() && out < *lhs.rbegin()) continue;
    scale++;
  }
  printf("%lld\n", (ret * scale) % 1000000007);
}
