#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  set<long long> b, s, both;
  long long n, ans = 1;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    string str;
    int cu;
    cin >> str >> cu;
    if (str.size() == 3) {
      if (b.size() && *b.rbegin() > cu)
        b.insert(cu);
      else if (s.size() && *s.begin() < cu)
        s.insert(cu);
      else
        both.insert(cu);
    } else {
      if ((b.size() && *b.rbegin() > cu) || (s.size() && *s.begin() < cu))
        ans = 0;
      else if (b.size() && *b.rbegin() == cu) {
        b.erase(cu);
        for (auto &e : both) s.insert(e);
      } else if (s.size() && *s.begin() == cu) {
        s.erase(cu);
        for (auto &e : both) b.insert(e);
      } else {
        ans = (ans * 2) % MOD;
        both.erase(cu);
        for (auto &e : both)
          if (e > cu)
            s.insert(e);
          else
            b.insert(e);
      }
      both.clear();
    }
  }
  ans = (ans * (both.size() + 1)) % MOD;
  cout << ans << endl;
  return 0;
}
