#include <bits/stdc++.h>
std::set<int> se;
int n;
int main() {
  scanf("%d", &n);
  int ans = 1, cnt = 1;
  se.insert(1e9);
  se.insert(-1e9);
  bool flag = false;
  char s[10];
  int a, max_ = 1e9, min_ = -1e9;
  std::set<int>::iterator it;
  while (n--) {
    scanf("%s%d", s, &a);
    if (flag) continue;
    if (s[1] == 'D') {
      se.insert(a);
      if (a > min_ && a < max_) cnt += 1;
    } else {
      if (!(min_ <= a && a <= max_)) {
        flag = true;
        continue;
      }
      cnt = 1;
      if (a != min_ && a != max_) ans = ans * 2 % 1000000007;
      se.erase(a);
      it = se.lower_bound(a);
      max_ = (*it);
      min_ = *(--it);
    }
  }
  if (flag) ans = 0;
  printf("%d\n", 1LL * ans * cnt % 1000000007);
  return 0;
}
