#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int sell = 308983066 + 1, buy = 0;
  int64_t res = 1, cur = 0, mod = 1e9 + 7;
  set<int> data;
  for (int i = 0; i != n; ++i) {
    string s;
    int p;
    cin >> s >> p;
    if (s == "ADD") {
      data.insert(p);
      if (buy < p && p < sell) ++cur;
    } else {
      data.erase(p);
      if (p == buy || p == sell) {
        auto it = data.lower_bound(p);
        if (data.empty())
          sell = 308983066 + 1, buy = 0;
        else if (it == data.end())
          sell = 308983066 + 1, buy = *(--it);
        else if (it == data.begin())
          sell = *it, buy = 0;
        else {
          sell = *it;
          buy = *(--it);
        }
        cur = 0;
        continue;
      }
      if (p < buy || p > sell) {
        res = 0;
        break;
      }
      res = (2 * res) % mod;
      cur = 0;
      auto it = data.lower_bound(p);
      if (data.empty())
        sell = 308983066 + 1, buy = 0;
      else if (it == data.end())
        sell = 308983066 + 1, buy = *(--it);
      else if (it == data.begin())
        sell = *it, buy = 0;
      else {
        sell = *it;
        buy = *(--it);
      }
    }
  }
  res = (res * (cur + 1)) % mod;
  cout << res << '\n';
  return 0;
}
