#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s[20];
set<int> S;
int mx, mn;
int main() {
  int T = read();
  S.insert(-1e9);
  S.insert(1e9);
  mx = 1e9;
  mn = -1e9;
  int wt = 1;
  int Ans = 1;
  while (T--) {
    scanf("%s", s);
    int x = read();
    if (s[1] == 'D') {
      S.insert(x);
      if (mn < x && x < mx) ++wt;
    } else {
      if (x < mn || x > mx) {
        return puts("0"), 0;
      }
      if (x != mn && x != mx) {
        Ans = Ans * 2 % 1000000007;
      }
      wt = 1;
      S.erase(x);
      set<int>::iterator it = S.lower_bound(x);
      mx = *it;
      mn = *(--it);
    }
  }
  printf("%d\n", 1ll * Ans * wt % 1000000007);
}
