#include <bits/stdc++.h>
using namespace std;
bool action[555555];
int value[555555];
int nextAccept[555555];
priority_queue<int> pq1, pq2;
int main(int argc, char *argv[]) {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < (N); i++) {
    char s[10];
    scanf("%s%d", s, value + i);
    action[i] = s[1] == 'C';
  }
  nextAccept[N] = -1;
  for (int i = (N - 1); i >= (0); i--)
    nextAccept[i] = action[i] ? value[i] : nextAccept[i + 1];
  int ans = 1, last = 1;
  for (int i = 0; i < (N); i++) {
    if (action[i]) {
      if (!pq1.empty() && pq1.top() == value[i]) {
        pq1.pop();
      } else if (!pq2.empty() && pq2.top() == -value[i]) {
        pq2.pop();
      } else {
        ans = 0;
        break;
      }
    } else {
      bool between = (pq1.empty() || pq1.top() < value[i]) &&
                     (pq2.empty() || -pq2.top() > value[i]);
      if (nextAccept[i] == -1) {
        if (between) last++;
        continue;
      }
      if (value[i] < nextAccept[i])
        pq1.push(value[i]);
      else if (value[i] > nextAccept[i])
        pq2.push(-value[i]);
      else if (between) {
        ans = (2 * ans) % 1000000007;
        pq1.push(value[i]);
      } else {
        ans = 0;
        break;
      }
    }
  }
  ans = ((long long)ans * last) % 1000000007;
  printf("%d\n", ans);
  return 0;
}
