#include <bits/stdc++.h>
long long MOD = 1e9 + 7;
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<int, int> p[410000];
  queue<int> q;
  for (int i = 0; i < n; i++) {
    string s;
    int a;
    cin >> s;
    scanf("%d", &a);
    int b, c;
    if (s[1] == 'D') {
      p[i] = {a, 0};
    } else {
      p[i] = {a, 1};
      q.push(a);
    }
  }
  priority_queue<int, vector<int>, greater<int>> p1;
  priority_queue<int> p2;
  long long ans = 1;
  int mem = 0;
  for (int i = 0; i < n; i++) {
    if (q.empty()) {
      int m, M;
      if (!p1.empty())
        M = p1.top();
      else
        M = 2 * 1e9;
      if (!p2.empty())
        m = p2.top();
      else
        m = 0;
      int count = 0;
      while (i != n) {
        int a = p[i].first;
        if (a < M && a > m) count++;
        i++;
      }
      ans = ans * (count + 1) % MOD;
    }
    if (p[i].second) {
      int a = q.front();
      q.pop();
      if (!p2.empty() && a < p2.top()) {
        cout << 0;
        return 0;
      }
      if (!p1.empty() && a > p1.top()) {
        cout << 0;
        return 0;
      }
      if (mem) {
        mem = 0;
        ans = ans * 2 % MOD;
      }
      if (!p1.empty() && p1.top() == a) {
        p1.pop();
      }
      if (!p2.empty() && p2.top() == a) {
        p2.pop();
      }
    } else {
      int a = p[i].first;
      if (a < q.front()) {
        p2.push(a);
      } else if (q.front() == a) {
        mem = 1;
      } else {
        p1.push(a);
      }
    }
  }
  cout << ans;
  return 0;
}
