#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool uin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
inline bool uax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
const int INF = 1e9, MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, s_best = -INF, b_best = INF;
  long long ans = 1, rem = 1;
  cin >> n;
  set<int> orders;
  for (int i = 0; i < n; ++i) {
    string op;
    int cur_price;
    cin >> op >> cur_price;
    if (op[1] == 'D') {
      if (cur_price <= b_best && cur_price >= s_best) ++rem;
      orders.insert(cur_price);
    } else {
      rem = 1;
      if (cur_price < s_best || cur_price > b_best) {
        ans = 0;
        break;
      }
      orders.erase(cur_price);
      if (cur_price > s_best && cur_price < b_best) ans = ans * 2LL % MOD;
      auto it = orders.upper_bound(cur_price);
      if (it == orders.end())
        b_best = INF;
      else
        b_best = *it;
      if (it == orders.begin())
        s_best = -INF;
      else
        s_best = *prev(it);
    }
  }
  cout << ans * rem % MOD << '\n';
}
