#include <bits/stdc++.h>
using namespace std;
template <class T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(long long &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const long long &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template <class T, class U>
void _W(const pair<T, U> &x) {
  _W(x.first);
  putchar(' ');
  _W(x.second);
}
template <class T>
void _W(const vector<T> &x) {
  for (auto i = x.begin(); i != x.end(); _W(*i++))
    if (i != x.cbegin()) putchar(' ');
}
void W() {}
template <class T, class... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
int MOD = 1e9 + 7;
void ADD(long long &x, long long v) {
  x = (x + v) % MOD;
  if (x < 0) x += MOD;
}
const int SIZE = 1e6 + 10;
int a[SIZE], v[SIZE];
const int ADDD = 0;
const int ACCEPT = 1;
int type[SIZE];
void error() {
  W(0);
  exit(0);
}
int main() {
  int n;
  R(n);
  char s[16];
  vector<int> d;
  for (int i = 0; i < (n); ++i) {
    scanf("%s", (s));
    if (s[1] == 'D')
      a[i] = ADDD;
    else
      a[i] = ACCEPT;
    R(v[i]);
    d.push_back(v[i]);
  }
  (sort(d.begin(), d.end()),
   d.resize(distance(d.begin(), unique(d.begin(), d.end()))));
  for (int i = 0; i < (n); ++i)
    v[i] = (lower_bound(d.begin(), d.end(), v[i]) - d.begin());
  set<int> pos, neg;
  vector<int> notyet;
  long long ans = 1;
  for (int i = 0; i < (n); ++i) {
    if (a[i] == ADDD) {
      if (pos.size() && v[i] >= *pos.begin()) {
        pos.insert(v[i]);
        type[v[i]] = 1;
      } else if (neg.size() && v[i] <= *neg.rbegin()) {
        neg.insert(v[i]);
        type[v[i]] = -1;
      } else {
        notyet.push_back(v[i]);
      }
    } else {
      if (pos.size() && *pos.begin() < v[i]) {
        error();
      }
      if (neg.size() && *neg.rbegin() > v[i]) {
        error();
      }
      if (type[v[i]] == 0)
        ans = ans * 2 % MOD;
      else if (type[v[i]] > 0)
        pos.erase(v[i]);
      else
        neg.erase(v[i]);
      for (int x : notyet) {
        if (x < v[i]) {
          type[x] = -1;
          neg.insert(x);
        } else if (x > v[i]) {
          type[x] = 1;
          pos.insert(x);
        }
      }
      notyet.clear();
    }
  }
  ans = ans * (((int)(notyet).size()) + 1) % MOD;
  W(ans);
  return 0;
}
