#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 10;
const int Mod = 1e9 + 7;
priority_queue<unsigned, vector<unsigned>, less<unsigned> > buy;
priority_queue<unsigned, vector<unsigned>, greater<unsigned> > sell;
unsigned st[N];
int n, c;
int main() {
  buy.push(0), sell.push(4000000000u);
  scanf("%d", &n);
  int ans = 1;
  for (int T = 1; T <= n; T++) {
    char op[10];
    unsigned x;
    scanf("%s%u", op, &x);
    if (op[1] == 'D') {
      if (x >= sell.top())
        sell.push(x);
      else if (x <= buy.top())
        buy.push(x);
      else
        st[++c] = x;
    } else {
      st[0] = buy.top(), st[c + 1] = sell.top();
      sort(st, st + c + 2);
      int p = lower_bound(st, st + c + 2, x) - st;
      if (p == c + 2 || st[p] != x) {
        puts("0");
        return 0;
      }
      if (!p)
        buy.pop();
      else if (p == c + 1)
        sell.pop();
      else
        ans = ans * 2 % Mod;
      for (int i = 1; i <= p - 1; i++) buy.push(st[i]);
      for (int i = p + 1; i <= c; i++) sell.push(st[i]);
      c = 0;
    }
  }
  ans = 1ll * ans * (c + 1) % Mod;
  printf("%d\n", ans);
  return 0;
}
