#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  set<int> s;
  map<int, long long> m;
  int inf = 1000000000;
  s.insert(inf);
  m[inf] = 1;
  vector<int> nonz;
  nonz.push_back(inf);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    int p;
    cin >> p;
    if (str == "ADD") {
      s.insert(p);
      auto it = s.find(p);
      it++;
      int phat = *it;
      m[p] = m[phat];
      nonz.push_back(p);
    } else {
      auto it = s.find(p);
      it++;
      int phat = *it;
      m[phat] = (m[phat] + m[p]) % mod;
      for (int j = 0; j < nonz.size(); j++) {
        if (nonz[j] == phat) {
          continue;
        }
        m[nonz[j]] = 0;
      }
      nonz.clear();
      nonz.push_back(phat);
      s.erase(s.find(p));
    }
  }
  auto it = s.begin();
  long long ans = 0LL;
  while (it != s.end()) {
    ans += m[*it];
    ans %= mod;
    it++;
  }
  cout << ans << endl;
}
