#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u32 = size_t;
template <typename T>
inline T sqr(const T& a) {
  return a * a;
}
const int MOD = int(1e9 + 7.1);
inline void madd(int& x, int delta) {
  x += (x + delta < MOD ? delta : delta - MOD);
}
i64 gcd(i64 a, i64 b) {
  while (a && b) (a > b ? a %= b : b %= a);
  return a + b;
}
i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
int main() {
  cin.sync_with_stdio(false);
  int T = 1;
  for (int iTest = 1; iTest <= T; ++iTest) {
    int n;
    cin >> n;
    int res = 1;
    vector<int> random;
    set<int> sells, buys;
    random.reserve(n);
    sells.insert(400000000);
    buys.insert(-1);
    for (int i = 0; i < n; ++i) {
      string query;
      int cost;
      cin >> query >> cost;
      if (query[1] == 'C') {
        if (*buys.rbegin() < cost && cost < *sells.begin()) {
          madd(res, res);
        } else if (cost == *buys.rbegin()) {
          buys.erase(cost);
        } else if (cost == *sells.begin()) {
          sells.erase(sells.begin());
        } else {
          res = 0;
          break;
        }
        for (int x : random) {
          if (x < cost) {
            buys.insert(x);
          } else if (x > cost) {
            sells.insert(x);
          }
        }
        random.clear();
      } else {
        if (*buys.rbegin() < cost && cost < *sells.begin()) {
          random.push_back(cost);
        } else if (cost < *buys.rbegin()) {
          buys.insert(cost);
        } else if (cost > *sells.begin()) {
          sells.insert(cost);
        } else {
          exit(1);
        }
      }
    }
    res =
        static_cast<int>((static_cast<i64>(res) * (random.size() + 1LL)) % MOD);
    cout << res << '\n';
  }
  return 0;
}
