#include <bits/stdc++.h>
using namespace std;
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(long long x) {
  static const long long maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  long long len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (long long i = len - 1; i >= 0; --i) putchar(s[i]);
}
long long n;
long long a[4001000], cnt;
char s[4001000];
long long ans = 1;
priority_queue<long long, vector<long long>, less<long long> > L;
priority_queue<long long, vector<long long>, greater<long long> > R;
const long long P = 1e9 + 7;
void ADD(long long x) {
  for (long long i = 1; i <= cnt; i++) {
    if (a[i] < x) {
      L.push(a[i]);
    } else if (a[i] > x) {
      R.push(a[i]);
    }
  }
  cnt = 0;
}
void doit(long long x) {
  if (L.size()) {
    if (x < L.top()) {
      ans = 0;
      return;
    }
    if (x == L.top()) {
      L.pop();
      ADD(x);
      return;
    }
  }
  if (R.size()) {
    if (x > R.top()) {
      ans = 0;
      return;
    }
    if (x == R.top()) {
      R.pop();
      ADD(x);
      return;
    }
  }
  ans = (ans * 2ll) % P;
  ADD(x);
}
int main() {
  scanf("%I64d", &n);
  ans = 1;
  for (long long i = 1; i <= n; i++) {
    scanf("%s", s);
    long long x;
    scanf("%I64d", &x);
    if (s[1] == 'D')
      a[++cnt] = x;
    else
      doit(x);
  }
  long long tmp = 0;
  long long L_MAX = -1e9;
  long long R_MIN = 1e9;
  if (L.size()) L_MAX = max(L_MAX, (long long)L.top());
  if (R.size()) R_MIN = min(R_MIN, (long long)R.top());
  for (int i = 1; i <= cnt; i++)
    if ((a[i] > L_MAX) && (a[i] < R_MIN)) tmp++;
  ans = 1ll * ans * (tmp + 1ll) % P;
  printf("%I64d\n", ans);
  return 0;
}
