#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int x;
  int type;
};
long long int mod = 1e9 + 7;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  node a[n];
  for (int i = 0; i < n; i++) {
    string s1;
    cin >> s1 >> a[i].x;
    if (s1 == "ADD") {
      a[i].type = 0;
    } else {
      a[i].type = 1;
    }
  }
  set<long long int> s;
  set<long long int> buy, sell;
  long long int ways = 1;
  int valid = 1;
  for (int i = 0; i < n; i++) {
    if (a[i].type == 1) {
      while (!s.empty()) {
        if (buy.empty()) break;
        int x = *s.begin();
        if (*buy.rbegin() < x) break;
        s.erase(x);
        buy.insert(x);
      }
      while (!s.empty()) {
        if (sell.empty()) break;
        int x = *s.rbegin();
        if (*sell.begin() > x) break;
        s.erase(x);
        sell.insert(x);
      }
      int is_in = 3;
      int x = a[i].x;
      if (buy.find(x) != buy.end()) {
        is_in = 0;
      } else if (s.find(x) != s.end()) {
        is_in = 1;
      } else if (sell.find(x) != sell.end()) {
        is_in = 2;
      }
      if (is_in == 0) {
        if (*buy.rbegin() != x) {
          valid = 0;
          break;
        }
        buy.erase(x);
        for (auto it : s) {
          sell.insert(it);
        }
        s.clear();
      } else if (is_in == 1) {
        for (auto it : s) {
          if (it < x) {
            buy.insert(it);
          } else if (it > x) {
            sell.insert(it);
          }
        }
        s.clear();
        ways *= 2;
        ways %= mod;
      } else if (is_in == 2) {
        if (*sell.begin() != x) {
          valid = 0;
          break;
        }
        sell.erase(x);
        for (auto it : s) {
          buy.insert(it);
        }
        s.clear();
      } else {
        valid = 0;
        break;
      }
      continue;
    }
    int j = i;
    while (j < n) {
      if (a[j].type == 1) break;
      s.insert(a[j].x);
      j++;
    }
    i = j - 1;
  }
  if (valid == 0) {
    cout << "0\n";
  } else {
    while (!s.empty()) {
      if (buy.empty()) break;
      int x = *s.begin();
      if (*buy.rbegin() < x) break;
      s.erase(x);
      buy.insert(x);
    }
    while (!s.empty()) {
      if (sell.empty()) break;
      int x = *s.rbegin();
      if (*sell.begin() > x) break;
      s.erase(x);
      sell.insert(x);
    }
    ways *= (long long)(s.size() + 1);
    ways %= mod;
    cout << ways << "\n";
  }
  return 0;
}
