#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline int chkmax(T &x, const T2 &y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline int chkmin(T &x, const T2 &y) {
  return x > y ? x = y, 1 : 0;
}
const int MAXN = (1 << 20);
const int mod = (int)1e9 + 7;
int n;
string type[MAXN];
int p[MAXN];
void read() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> type[i];
    cin >> p[i];
  }
}
set<int> st;
int last_low = -1, last_high = mod;
void solve() {
  int last_ac = 0;
  for (int i = 1; i <= n; i++)
    if (type[i] == "ACCEPT") last_ac = i;
  int answer = 1;
  for (int i = 1; i <= n; i++) {
    if (type[i] == "ADD")
      st.insert(p[i]);
    else {
      if (last_low > p[i] || last_high < p[i]) {
        cout << 0 << '\n';
        return;
      }
      auto it = st.find(p[i]);
      if (it == st.end()) {
        cout << 0 << '\n';
        return;
      }
      if (p[i] != last_low && p[i] != last_high) answer = (answer * 2ll) % mod;
      if (it == st.begin())
        last_low = -1;
      else
        last_low = *prev(it);
      if (it == prev(st.end()))
        last_high = mod;
      else
        last_high = *next(it);
      st.erase(it);
    }
  }
  int cnt_between = 1;
  for (int i = last_ac + 1; i <= n; i++)
    if (last_low <= p[i] && p[i] <= last_high) cnt_between++;
  answer = answer * 1ll * cnt_between % mod;
  cout << answer << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
