#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& out, vector<T> v) {
  for (T t : v) out << t << ' ';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, set<T> v) {
  for (T t : v) out << t << ' ';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, pair<T, T> v) {
  out << v.first << ' ' << v.second;
  return out;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  priority_queue<int, vector<int>, greater<int> > mi;
  priority_queue<int, vector<int>, less<int> > ma;
  set<int> temp;
  long long res = 1;
  for (int i = 0; i < n; ++i) {
    string s;
    int num;
    cin >> s >> num;
    if (s == "ADD") {
      if (!mi.empty() && num > mi.top())
        mi.push(num);
      else if (!ma.empty() && num < ma.top())
        ma.push(num);
      else
        temp.insert(num);
    } else {
      int chantren = INT_MAX;
      if (!mi.empty()) chantren = mi.top();
      int chanduoi = 0;
      if (!ma.empty()) chanduoi = ma.top();
      if (num < chanduoi || num > chantren) {
        cout << 0;
        return 0;
      }
      if (!mi.empty() && num == mi.top()) {
        mi.pop();
      } else if (!ma.empty() && num == ma.top()) {
        ma.pop();
      } else if (temp.find(num) != temp.end())
        res = (res * 2) % (int)(1e9 + 7);
      else {
        cout << 0;
        return 0;
      }
      for (int t : temp) {
        if (t > num)
          mi.push(t);
        else if (t < num)
          ma.push(t);
      }
      temp.clear();
    }
  }
  cout << (res * (temp.size() + 1)) % ((int)1e9 + 7);
  return 0;
}
