#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int M = 1e9 + 7;
const int MAXN = 1e6 + 10;
int t[4 * MAXN], q[4 * MAXN], s[4 * MAXN], n;
void upd(int v, int l, int r, int pos, int val) {
  if (l == r) {
    t[v] = (val == 1 ? pos : 0);
    q[v] = (val == 1 ? pos : n + 1);
    s[v] += val;
  } else {
    int m = (l + r) / 2;
    if (pos <= m) {
      upd(2 * v, l, m, pos, val);
    } else {
      upd(2 * v + 1, m + 1, r, pos, val);
    }
    t[v] = max(t[2 * v], t[2 * v + 1]);
    q[v] = min(q[2 * v], q[2 * v + 1]);
    s[v] = s[2 * v] + s[2 * v + 1];
  }
}
int getS(int v, int l, int r, int L, int R) {
  if (r < L || R < l || R < L) return 0;
  if (L <= l && r <= R) return s[v];
  int m = (l + r) / 2;
  return getS(2 * v, l, m, L, R) + getS(2 * v + 1, m + 1, r, L, R);
}
int getLast(int v, int l, int r, int L, int R) {
  if (r < L || R < l || R < L) return 0;
  if (L <= l && r <= R) return t[v];
  int m = (l + r) / 2;
  return max(getLast(2 * v, l, m, L, R), getLast(2 * v + 1, m + 1, r, L, R));
}
int getFirst(int v, int l, int r, int L, int R) {
  if (r < L || R < l || R < L) return n + 1;
  if (L <= l && r <= R) return q[v];
  int m = (l + r) / 2;
  return min(getFirst(2 * v, l, m, L, R), getFirst(2 * v + 1, m + 1, r, L, R));
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  map<int, int> compress;
  vector<pair<string, int>> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
    compress[v[i].second];
  }
  int kk = 0;
  for (auto &it : compress) {
    it.second = ++kk;
  }
  for (int i = 1; i <= n; i++) {
    upd(1, 1, n, i, 0);
  }
  int l = 0, r = n + 1;
  bool wasAccept = false;
  int ans = 1;
  for (int i = 0; i < n; i++) {
    v[i].second = compress[v[i].second];
    if (v[i].first == "ADD") {
      upd(1, 1, n, v[i].second, 1);
    } else {
      if (!wasAccept) {
        wasAccept = true;
        ans = (ans * 2) % M;
      } else {
        if (v[i].second < l || v[i].second > r) {
          ans = 0;
          break;
        } else if (v[i].second != l && v[i].second != r) {
          ans = (ans * 2) % M;
        }
      }
      l = getLast(1, 1, n, 1, v[i].second - 1);
      r = getFirst(1, 1, n, v[i].second + 1, n);
      upd(1, 1, n, v[i].second, -1);
    }
  }
  ans = ans * 1ll * (1 + getS(1, 1, n, l + 1, r - 1)) % M;
  cout << ans;
}
