#include <bits/stdc++.h>
using namespace std;
int n;
set<int> ss;
set<int> buy;
set<int> sell;
void no() {
  cout << 0 << "\n";
  exit(0);
}
int main() {
  cin >> n;
  long long int ans = 1;
  for (int i = 0; i < n; ++i) {
    string s;
    int p;
    cin >> s >> p;
    if (s.size() == 3) {
      if (!buy.empty() && *buy.rbegin() >= p) {
        buy.insert(p);
      } else if (!sell.empty() && *sell.begin() <= p) {
        sell.insert(p);
      } else {
        ss.insert(p);
      }
    } else {
      if (!buy.empty() && *buy.rbegin() > p) no();
      if (!sell.empty() && *sell.begin() < p) no();
      if (buy.count(p)) {
        buy.erase(p);
        for (int x : ss) sell.insert(x);
        ss.clear();
      } else if (sell.count(p)) {
        sell.erase(p);
        for (int x : ss) buy.insert(x);
        ss.clear();
      } else {
        ss.erase(p);
        ans = (ans * 2) % 1000000007;
        for (int x : ss) {
          if (x < p)
            buy.insert(x);
          else
            sell.insert(x);
        }
        ss.clear();
      }
    }
  }
  ans = (ans * (ss.size() + 1)) % 1000000007;
  cout << ans << "\n";
  return 0;
}
