#include <bits/stdc++.h>
using std::abs;
using std::array;
using std::cerr;
using std::cin;
using std::cout;
using std::generate;
using std::get;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::pair;
using std::reverse;
using std::set;
using std::sort;
using std::string;
using std::tuple;
using std::unique;
using std::vector;
template <typename T>
T input() {
  T res;
  cin >> res;
  {};
  return res;
}
template <typename IT>
void input_seq(IT b, IT e) {
  std::generate(b, e,
                input<typename std::remove_reference<decltype(*b)>::type>);
}
const int mod = 1000 * 1000 * 1000 + 7;
int main() {
  std::iostream::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T = input<int>();
  int64_t ans = 1;
  set<int> buy, any, sell;
  for (int z = 0; z != T; ++z) {
    if (input<string>() == "ADD") {
      int val = input<int>();
      if (not buy.empty() and val < (*buy.rbegin()))
        buy.insert(val);
      else if (not sell.empty() and val > (*sell.begin()))
        sell.insert(val);
      else
        any.insert(val);
    } else {
      int val = input<int>();
      if (buy.count(val)) {
        if (val != (*buy.rbegin())) {
          goto fi;
        }
        buy.erase(val);
      } else if (sell.count(val)) {
        if (val != (*sell.begin())) {
          goto fi;
        }
        sell.erase(val);
      } else {
        assert(any.count(val));
        ans *= 2;
        ans %= mod;
        any.erase(val);
      }
      for (auto elem : any)
        if (elem < val)
          buy.insert(elem);
        else
          sell.insert(elem);
      any.clear();
    }
  }
  ans *= (int((any).size()) + 1);
  ans %= mod;
  cout << ans << "\n";
  return 0;
fi:;
  cout << "0\n";
  return 0;
}
