#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
template <class T>
void dbs(string str, T t) {
  cout << str << " : " << t << endl;
}
template <class T, class... second>
void dbs(string str, T t, second... s) {
  int idx = str.find(',');
  cout << str.substr(0, idx) << " : " << t << ",";
  dbs(str.substr(idx + 1), s...);
}
template <class second, class T>
ostream& operator<<(ostream& os, const pair<second, T>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class second, class T>
ostream& operator<<(ostream& os, const map<second, T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
void prc(T a, T b) {
  cout << "[";
  for (T i = a; i != b; ++i) {
    if (i != a) cout << ", ";
    cout << *i;
  }
  cout << "]";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  set<int> B, second;
  set<int> active;
  int ans = 1;
  for (auto i = (0); i <= (n - 1); ++i) {
    string s;
    int x;
    cin >> s >> x;
    if (s == "ADD") {
      if (!B.empty() and x <= *(--B.end())) {
        B.insert(x);
      } else if (!second.empty() and x >= *(second.begin())) {
        second.insert(x);
      } else {
        active.insert(x);
      }
    } else {
      if (!B.empty() and *(--B.end()) > x) return cout << "0", 0;
      if (!second.empty() and *(second.begin()) < x) return cout << "0", 0;
      if (!B.count(x) and !second.count(x)) {
        ans += ans;
        if (ans >= inf) ans -= inf;
      }
      B.erase(x), second.erase(x);
      active.erase(x);
      for (auto it : active) {
        if (it < x)
          B.insert(it);
        else
          second.insert(it);
      }
      active.clear();
    }
  }
  ans = (ans * 1LL * (int(active.size()) + 1)) % inf;
  cout << ans << "\n";
  return 0;
}
