#include <bits/stdc++.h>
using namespace std;
long long int getMaximumFromSet(set<long long int> &s) {
  if (s.empty()) return -1;
  auto it = s.end();
  --it;
  return *it;
}
long long int getMinimumFromSet(set<long long int> &s) {
  if (s.empty()) return INT64_MAX;
  auto it = s.begin();
  return *it;
}
long long int getPower(long long int b, long long int p) {
  if (p == 0) return 1;
  if (p == 1) return b;
  long long int half = getPower(b, p / 2) % 1000000007;
  if (p % 2 == 0) {
    long long int ans = half * half;
    ans = ans % 1000000007;
    return ans;
  }
  long long int ans = half * half;
  ans = ans % 1000000007;
  ans = ans * b;
  ans = ans % 1000000007;
  return ans;
}
int main() {
  long long int n;
  scanf("%lld", &n);
  vector<string> commands;
  vector<long long int> p;
  for (long long int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    long long int t;
    cin >> t;
    commands.push_back(s);
    p.push_back(t);
  }
  set<long long int> s, sell, buy;
  long long int i = 0;
  long long int p2 = 0;
  while (i < n) {
    long long int start = i;
    long long int end = i;
    while (end < n && commands[end] != "ACCEPT") {
      ++end;
    }
    if (end == n) {
      long long int a, b;
      a = getMaximumFromSet(buy);
      b = getMinimumFromSet(sell);
      long long int cnt = 1;
      for (long long int j = start; j < end; ++j) {
        if (p[j] > a && p[j] < b) ++cnt;
      }
      cnt = cnt % 1000000007;
      long long int ans = getPower(2, p2);
      ans = ans % 1000000007;
      ans = ans * cnt;
      ans = ans % 1000000007;
      cout << ans;
      return 0;
    }
    long long int a, b;
    a = getMaximumFromSet(buy);
    b = getMinimumFromSet(sell);
    long long int tobeRemoved = p[end];
    if (tobeRemoved < a || tobeRemoved > b) {
      cout << 0;
      return 0;
    }
    if (tobeRemoved == a) {
      buy.erase(a);
    } else if (tobeRemoved == b) {
      sell.erase(b);
    } else {
      ++p2;
    }
    for (long long int j = start; j < end; ++j) {
      if (p[j] == tobeRemoved) continue;
      if (p[j] > tobeRemoved)
        sell.insert(p[j]);
      else
        buy.insert(p[j]);
    }
    i = end + 1;
  }
  long long int ans = getPower(2, p2);
  ans = ans % 1000000007;
  cout << ans;
  return 0;
}
