#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
bool minimize(X &x, const Y &y) {
  X eps = 1e-9;
  if (x > y + eps) {
    x = y;
    return true;
  } else
    return false;
}
template <class X, class Y>
bool maximize(X &x, const Y &y) {
  X eps = 1e-9;
  if (x + eps < y) {
    x = y;
    return true;
  } else
    return false;
}
template <class T>
T Abs(const T &x) {
  return (x < 0 ? -x : x);
}
const string ADD = "ADD";
const string REMOVE = "ACCEPT";
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9 + 7;
int numQuery;
pair<string, int> queries[500500];
map<int, int> status;
void foundError(void) {
  cout << 0 << endl;
  exit(EXIT_SUCCESS);
}
void setStatus(int key, int value) {
  int &cur = status[key];
  if (cur == value || cur == 0)
    cur = value;
  else
    foundError();
}
int getStatus(int key) { return status[key]; }
int getMax(const set<int> &s) {
  __typeof(s.begin()) it = s.end();
  it--;
  return *it;
}
int getMin(const set<int> &s) {
  __typeof(s.begin()) it = s.begin();
  return *it;
}
void checkSet(const set<int> &___left, const set<int> &___right) {
  if (___left.empty() || ___right.empty()) return;
  if (getMax(___left) < getMin(___right)) return;
  foundError();
}
void process(void) {
  cin >> numQuery;
  for (int i = (1), _b = (numQuery); i <= _b; i++)
    cin >> queries[i].first >> queries[i].second;
  for (int i = (1), _b = (numQuery); i <= _b; i++)
    status[queries[i].second] = 0;
  set<int> types[3];
  for (int i = (1), _b = (numQuery); i <= _b; i++) {
    int key = queries[i].second;
    if (queries[i].first == ADD) {
      if (!types[2].empty() && key > getMin(types[2])) setStatus(key, 1);
      if (!types[0].empty() && key < getMax(types[0])) setStatus(key, -1);
      types[getStatus(key) + 1].insert(key);
    } else {
      while (!types[1].empty()) {
        int tmp = getMin(types[1]);
        types[1].erase(tmp);
        if (tmp == key) continue;
        int newStatus = tmp < key ? -1 : 1;
        setStatus(tmp, newStatus);
        types[newStatus + 1].insert(tmp);
      }
      types[getStatus(key) + 1].erase(key);
    }
    for (int j = (0), _b = (2); j <= _b; j++)
      for (int k = (j + 1), _b = (2); k <= _b; k++)
        checkSet(types[j], types[k]);
  }
  int numFinalUnknown = types[1].size();
  for (int i = 0, _n = (3); i < _n; i++) types[i].clear();
  for (int i = (1), _b = (numQuery); i <= _b; i++) {
    int key = queries[i].second;
    int stt = getStatus(key);
    if (queries[i].first == ADD)
      types[stt + 1].insert(key);
    else {
      if (stt == -1 && key != getMax(types[0])) foundError();
      if (stt == 1 && key != getMin(types[2])) foundError();
      types[stt + 1].erase(key);
    }
    for (int j = (0), _b = (2); j <= _b; j++)
      for (int k = (j + 1), _b = (2); k <= _b; k++)
        checkSet(types[j], types[k]);
  }
  int numUnknown = 0;
  for (__typeof((status).begin()) it = (status).begin(); it != (status).end();
       it++)
    if (it->second == 0) numUnknown++;
  int res = 1;
  for (int love = 0, _n = (numUnknown - numFinalUnknown); love < _n; love++)
    res = res * 2 % MOD;
  cout << 1LL * res * (numFinalUnknown + 1) % MOD << endl;
}
int main(void) {
  ios::sync_with_stdio(false);
  process();
  return 0;
}
