#include <bits/stdc++.h>
using namespace std;
void guan() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long mod2 = 1009050431;
const long long mod3 = 784514251;
const long long hash_mod[] = {998244353, 1009050431, 784514251};
const int INF = 0x7FFFFFFF;
const long long LINF = 0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const long long maxx = 1LL << 61;
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const int maxn = 1010101;
string s;
pair<long long, long long> a[maxn];
struct cmp1 {
  bool operator()(pair<long long, long long> &a,
                  pair<long long, long long> &b) const {
    return a.second > b.second;
  }
};
struct cmp2 {
  bool operator()(pair<long long, long long> &a,
                  pair<long long, long long> &b) const {
    return a.second < b.second;
  }
};
int main() {
  guan();
  int t = 1;
  while (t--) {
    int n;
    while (cin >> n) {
      priority_queue<pair<long long, long long>,
                     vector<pair<long long, long long> >, cmp1>
          q1;
      priority_queue<pair<long long, long long>,
                     vector<pair<long long, long long> >, cmp2>
          q2;
      queue<long long> q;
      long long p;
      long long ans = 1;
      for (int i = 1; i <= n; ++i) {
        cin >> s >> a[i].second;
        if (s == "ADD")
          a[i].first = 1;
        else {
          a[i].first = 2;
          q.push(a[i].second);
        }
      }
      long long nextval = -1, sum = 1;
      if (!q.empty()) nextval = q.front(), q.pop();
      pair<long long, long long> temp;
      for (int i = 1; i <= n; ++i) {
        if (nextval == -1) {
          if ((q1.empty() || a[i].second < q1.top().second) &&
              (q2.empty() || a[i].second > q2.top().second))
            sum = (sum + 1) % mod;
        } else if (a[i].first == 1) {
          a[i].first = nextval;
          if (a[i].second >= nextval)
            q1.push(a[i]);
          else
            q2.push(a[i]);
        } else {
          if (!q1.empty() && q1.top().second == nextval) {
            temp = q1.top();
            q1.pop();
            if (temp.first == nextval) ans = ans * 2 % mod;
          } else if (!q2.empty() && q2.top().second == nextval) {
            temp = q2.top();
            q2.pop();
          } else
            ans = 0;
          if (!q.empty())
            nextval = q.front(), q.pop();
          else
            nextval = -1;
        }
        if (ans == 0) break;
      }
      cout << ans * sum % mod << endl;
    }
  }
  return 0;
}
