#include <bits/stdc++.h>
using namespace std;
const int maxx = 600010;
const double pi = acos(-1.0);
const double eps = 1e-15;
int t, n, m, x, y, z, root, val;
int sum = 0, cnt = 0, l = 0, r = 0;
int a[maxx];
long long ans = 0, total = 0;
char c[maxx];
struct node {
  int l, r, val, siz, key;
} e[maxx];
void update(int now) { e[now].siz = e[e[now].l].siz + e[e[now].r].siz + 1; }
void split(int now, int val, int &x, int &y) {
  if (!now)
    x = y = 0;
  else {
    if (e[now].val <= val) {
      x = now;
      split(e[x].r, val, e[x].r, y);
    } else {
      y = now;
      split(e[y].l, val, x, e[y].l);
    }
    update(now);
  }
  return;
}
int merge(int x, int y) {
  if (!x || !y) return x + y;
  if (e[x].key <= e[y].key) {
    e[x].r = merge(e[x].r, y);
    update(x);
    return x;
  } else {
    e[y].l = merge(x, e[y].l);
    update(y);
    return y;
  }
}
int build(int val) {
  e[++cnt].val = val;
  e[cnt].key = rand();
  e[cnt].siz = 1;
  return cnt;
}
void insert(int val) {
  split(root, val - 1, x, y);
  root = merge(merge(x, build(val)), y);
}
void del(int val) {
  split(root, val, x, z);
  split(x, val - 1, x, y);
  y = merge(e[y].l, e[y].r);
  root = merge(merge(x, y), z);
}
int rk(int val) {
  split(root, val - 1, x, y);
  int u = e[x].siz + 1;
  root = merge(x, y);
  return u;
}
int atrank(int k) {
  int now = root;
  while (1) {
    if (e[e[now].l].siz + 1 == k)
      break;
    else if (e[e[now].l].siz >= k)
      now = e[now].l;
    else
      k -= e[e[now].l].siz + 1, now = e[now].r;
  }
  return e[now].val;
}
int main() {
  scanf("%d", &n);
  srand(time(NULL));
  l = -1, r = n + 1;
  ans = 1;
  for (int i = 1; i <= n; i++) {
    scanf(" %s %d", c + 1, &val);
    if (c[2] == 'D') {
      insert(val), total++;
      int u = rk(val);
      if (u <= r) r++;
      if (u <= l) l++;
    } else {
      int u = rk(val);
      del(val);
      if (l == u)
        l = u - 1, r = u;
      else if (r == u)
        l = u - 1, r = u;
      else if (l < u && r > u) {
        r = u, l = u - 1;
        total--;
        ans = ans * 2ll % 1000000007;
      } else {
        printf("0");
        return 0;
      }
    }
  }
  if (l == -1)
    ans += total;
  else
    ans = ans * (r - l) % 1000000007;
  printf("%lld", ans);
  return 0;
}
