#include <bits/stdc++.h>
using namespace std;
long long M = (long long)(1e9 + 7);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  set<int> buy, sell, st;
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    int p;
    cin >> p;
    if (s == "ADD") {
      if (!buy.empty() && *buy.rbegin() >= p) {
        buy.insert(p);
      } else if (!sell.empty() && *sell.begin() <= p) {
        sell.insert(p);
      } else {
        st.insert(p);
      }
    } else {
      if (!buy.empty() && *buy.rbegin() > p) {
        cout << "0" << endl;
        return 0;
      }
      if (!sell.empty() && *sell.begin() < p) {
        cout << "0" << endl;
        return 0;
      }
      if (buy.find(p) != buy.end()) {
        buy.erase(buy.find(p));
        for (set<int>::iterator it = st.begin(); it != st.end(); it++) {
          sell.insert(*it);
        }
        st.clear();
      } else if (sell.find(p) != sell.end()) {
        sell.erase(sell.find(p));
        for (set<int>::iterator it = st.begin(); it != st.end(); it++) {
          buy.insert(*it);
        }
        st.clear();
      } else {
        st.erase(p);
        ans = (ans * 2) % M;
        for (set<int>::iterator x = st.begin(); x != st.end(); x++) {
          if (p > *x) {
            buy.insert(*x);
          } else {
            sell.insert(*x);
          }
        }
        st.clear();
      }
    }
  }
  cout << (ans * (1 + (int)st.size())) % M << endl;
}
