#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, fu = 0;
  char ch = getchar();
  for (; ch < 48 || ch > 57; ch = getchar()) fu |= (ch == '-');
  for (; ch > 47 && ch < 58; ch = getchar()) x = x * 10 + ch - '0';
  return fu ? -x : x;
}
int n, mx = -1000000000, mn = 1000000000, ans = 1, tmp, no;
set<int> s;
char S[20];
int main() {
  for (n = read(), s.insert(mx), s.insert(mn); n--;) {
    scanf("%s", S), tmp = read();
    if (S[1] == 'D')
      s.insert(tmp), no += (tmp > mx && tmp < mn);
    else {
      if (tmp < mx || tmp > mn) return puts("0"), 0;
      ans = (tmp > mx && tmp < mn) ? (ans << 1) % 1000000007 : ans;
      s.erase(tmp), no = 0;
      set<int>::iterator it = s.lower_bound(tmp);
      mn = *it, --it, mx = *it;
    }
  }
  printf("%d\n", (int)(1LL * ans * (no + 1) % 1000000007));
  return 0;
}
