#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\t';
  err(++it, args...);
}
const int NN = 1e5 + 2, mod = 1e9 + 7;
void solve() {
  int i, j, k, p, n, sell_stock = mod, buy_sell = 1;
  string s;
  cin >> n;
  map<int, int> book;
  long long int ans = 1, curr_val = 1;
  book.insert({mod, 0});
  for (i = 0; i < (n); i++) {
    cin >> s >> p;
    if (s.length() == 3) {
      auto it = book.upper_bound(p);
      if (it->first == sell_stock ||
          (it != book.end() && it->second == buy_sell)) {
        book[p] = buy_sell;
        curr_val++;
      } else {
        book[p] = 0;
      }
    } else {
      auto it = book.upper_bound(p);
      if (book.find(p)->second == buy_sell) {
        buy_sell++;
        curr_val = 2;
      } else if (p == sell_stock || it->first == sell_stock) {
        buy_sell++;
        curr_val = 1;
      } else if (it->second == buy_sell) {
        curr_val = 1;
        buy_sell++;
      } else {
        cout << 0 << endl;
        return;
      }
      ans = (ans * curr_val) % mod;
      curr_val = 1;
      sell_stock = it->first;
      book.erase(p);
    }
  }
  ans = (ans * curr_val) % mod;
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1, tc;
  for (tc = 1; tc < (T + 1); tc++) {
    solve();
  }
  return 0;
}
