#include <bits/stdc++.h>
using namespace std;
const int N = 4e5;
set<int> b;
set<int> s;
set<int> u;
long long ans = 1;
long long p = 1e9 + 7;
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string t;
    int q;
    cin >> t >> q;
    if (t[1] == 'D') {
      if (b.lower_bound(q) != b.end())
        b.insert(q);
      else if (s.lower_bound(q) != s.begin())
        s.insert(q);
      else
        u.insert(q);
    } else {
      if (b.find(q) != b.end()) {
        auto g = b.end();
        --g;
        if (*g > q) {
          cout << "0\n";
          return 0;
        }
        b.erase(q);
        while (!u.empty()) {
          auto g = u.begin();
          s.insert(*g);
          u.erase(g);
        }
      } else if (s.find(q) != s.end()) {
        auto g = s.begin();
        if (*g < q) {
          cout << "0\n";
          return 0;
        }
        s.erase(q);
        while (!u.empty()) {
          auto g = u.begin();
          b.insert(*g);
          u.erase(g);
        }
      } else if (u.find(q) == u.end()) {
        cout << "0\n";
        return 0;
      } else {
        ans = (ans * 2) % p;
        while (!u.empty()) {
          auto g = u.begin();
          if (*g < q) b.insert(*g);
          if (*g > q) s.insert(*g);
          u.erase(g);
        }
      }
    }
  }
  cout << (ans * (long long)(u.size() + 1)) % p << endl;
  return 0;
}
