#include <bits/stdc++.h>
using namespace std;
const int N = 365000;
const long long mod = 1e9 + 7;
struct order {
  long long a, b, c;
};
bool operator<(const order &a, const order &b) { return a.a < b.a; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  set<order> second;
  second.insert({1LL << 60, 1, 0});
  int idx = 0;
  for (int i = 0; i < n; ++i) {
    string typ;
    long long v;
    cin >> typ >> v;
    if (typ == "ADD") {
      auto r = second.upper_bound({v, 0, 0});
      second.insert({v, r->c == idx ? r->b : 0, idx});
    } else {
      auto l = second.lower_bound({v, 0, 0}),
           r = second.upper_bound({v, 1LL << 60, 0});
      order tmp = {r->a,
                   ((l->c == idx ? l->b : 0) + (r->c == idx ? r->b : 0)) % mod,
                   ++idx};
      second.erase(l), second.erase(r), second.insert(tmp);
    }
  }
  long long ans = 0;
  for (order i : second)
    if (i.c == idx) ans = (ans + i.b) % mod;
  printf("%lld\n", ans);
  return 0;
}
