#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
char line[100];
const int MOD = 1e9l + 7;
int main(int argc, char **argv) {
  const int ADD = 0, AC = 1;
  const int UNKNOWN = 0, BUY = 1, SELL = 2;
  int n;
  scanf("%d", &n);
  vector<int> cmd(n), p(n);
  map<int, int> direction;
  for (int i = 0; i < n; i++) {
    scanf("%s %d", line, &p[i]);
    if (line[1] == 'D') {
      cmd[i] = ADD;
    } else {
      cmd[i] = AC;
    }
  }
  const int PINF = 308983066 + 1;
  int res = 1;
  set<int> maxbuyst, minselst;
  int b = 0;
  for (int i = 0; i < n; i++) {
    if (cmd[i] == AC) {
      int t = 0;
      if (maxbuyst.empty() || p[i] >= -*maxbuyst.begin()) {
        if (direction.count(p[i]) == 0 || direction[p[i]] == BUY) {
          t++;
        }
      }
      if (minselst.empty() || p[i] <= *minselst.begin()) {
        if (direction.count(p[i]) == 0 || direction[p[i]] == SELL) {
          t++;
        }
      }
      res = (res * t) % MOD;
      for (int j = b; j < i; j++) {
        if (p[j] < p[i]) {
          maxbuyst.insert(-p[j]);
          direction[p[j]] = BUY;
        } else if (p[j] > p[i]) {
          minselst.insert(p[j]);
          direction[p[j]] = SELL;
        }
      }
      maxbuyst.erase(-p[i]);
      minselst.erase(p[i]);
      direction.erase(p[i]);
      if (minselst.size() && maxbuyst.size() &&
          *minselst.begin() <= -*maxbuyst.begin()) {
        res = 0;
        break;
      }
      b = i + 1;
    } else if (i == n - 1) {
      int maxbuy0 = 0;
      if (maxbuyst.size()) {
        maxbuy0 = -*maxbuyst.begin();
      }
      int minsel0 = PINF;
      if (minselst.size()) {
        minsel0 = *minselst.begin();
      }
      int t = 0;
      if (maxbuy0 > 0) {
        t++;
      }
      for (int j = b; j < n; j++) {
        if (p[j] > maxbuy0 && p[j] < minsel0) {
          t++;
        }
      }
      if (maxbuy0 == 0) {
        t++;
      }
      t %= MOD;
      res = (1LL * res * t) % MOD;
    }
  }
  printf("%d\n", res);
  return 0;
}
