#include <bits/stdc++.h>
int a[400004], b[400004], t1 = 0, t = 0, c[400004];
void gouzao(long long v) {
  if (v == 1) return;
  if (a[v] < a[v / 2]) {
    std::swap(a[v], a[v / 2]);
    gouzao(v / 2);
  }
}
void xiugai(long long v) {
  if (v * 2 > t)
    return;
  else if (v * 2 == t) {
    if (a[v] > a[v * 2]) std::swap(a[v], a[v * 2]);
    return;
  } else {
    if (a[v] <= a[v * 2] && a[v] <= a[v * 2 + 1]) return;
    if (a[v * 2] < a[v * 2 + 1]) {
      std::swap(a[v * 2], a[v]);
      xiugai(v * 2);
    } else {
      std::swap(a[v * 2 + 1], a[v]);
      xiugai(v * 2 + 1);
    }
  }
}
void gouzao1(long long v) {
  if (v == 1) return;
  if (b[v] > b[v / 2]) {
    std::swap(b[v], b[v / 2]);
    gouzao1(v / 2);
  }
}
void xiugai1(long long v) {
  if (v * 2 > t1)
    return;
  else if (v * 2 == t1) {
    if (b[v] < b[v * 2]) std::swap(b[v], b[v * 2]);
    return;
  } else {
    if (b[v] >= b[v * 2] && b[v] >= b[v * 2 + 1]) return;
    if (b[v * 2] > b[v * 2 + 1]) {
      std::swap(b[v * 2], b[v]);
      xiugai1(v * 2);
    } else {
      std::swap(b[v * 2 + 1], b[v]);
      xiugai1(v * 2 + 1);
    }
  }
}
int mod = 1e9 + 7;
int main() {
  int n = 0, x = 0, q;
  std::cin >> q;
  long long gg = 1;
  while (q--) {
    char d[10];
    int p;
    scanf("%s%d", d, &p);
    if (d[1] == 'D')
      c[++x] = p;
    else {
      int w = 0;
      if (t1 && p == b[1]) {
        w = 1;
        std::swap(b[1], b[t1--]), xiugai1(1);
        for (int i = 1; i <= x; i++) {
          if (c[i] > p)
            a[++t] = c[i], gouzao(t);
          else if (c[i] == p)
            w = 0;
          else
            b[++t1] = c[i], gouzao1(t1);
        }
      } else if (t && p == a[1]) {
        w = 1;
        std::swap(a[1], a[t--]), xiugai(1);
        for (int i = 1; i <= x; i++) {
          if (c[i] > p)
            a[++t] = c[i], gouzao(t);
          else if (c[i] == p)
            w = 0;
          else
            b[++t1] = c[i], gouzao1(t1);
        }
      } else {
        for (int i = 1; i <= x; i++) {
          if (c[i] > p)
            a[++t] = c[i], gouzao(t);
          else if (c[i] == p)
            w = 2;
          else
            b[++t1] = c[i], gouzao1(t1);
        }
      }
      x = 0;
      gg = gg * w % mod;
    }
  }
  if (x) {
    int y = 1;
    for (int i = 1; i <= x; i++) {
      if ((c[i] < a[1] || !t) && (c[i] > b[1] || !t1)) y++;
    }
    gg = gg * y % mod;
  }
  std::cout << gg << std::endl;
}
