#include <bits/stdc++.h>
using namespace std;
inline void IO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
inline int dcmp(long double x) { return x < -1e-12 ? -1 : (x > 1e-12); }
int dx4[] = {0, 0, -1, +1};
int dy4[] = {+1, -1, 0, 0};
int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
inline void I(int& a) { scanf("%d", &a); }
inline void I(long long int& a) { scanf("%I64d", &a); }
inline void I(char* a) { scanf("%s", a); }
inline void I(string& a) {
  char b[2000010];
  scanf("%s", b);
  a = b;
}
inline void I(unsigned long long int& a) { scanf("%I64u", &a); }
template <typename T, typename... Args>
void I(T& a, Args&... args) {
  I(a);
  I(args...);
}
inline void OUT(int a) { printf("%d", a); }
inline void OUT(long long int a) { printf("%I64d", a); }
inline void OUT(const char* a) { printf("%s", a); }
inline void OUT(char* a) { printf("%s", a); }
inline void OUT(bool a) { printf("%d", a); }
inline void OUT(string a) {
  for (__typeof(a.end()) it = (a.begin()) - ((a.begin()) > (a.end()));
       it != (a.end()) - ((a.begin()) > (a.end()));
       it += 1 - 2 * ((a.begin()) > (a.end())))
    printf("%c", *it);
}
inline void OUT(unsigned long long int a) { printf("%I64u", a); }
template <typename T, typename... Args>
void OUT(T a, Args... args) {
  OUT(a);
  OUT(" ");
  OUT(args...);
}
template <typename... Args>
void O(Args... args) {
  OUT(args...);
  OUT("\n");
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const int M = 50;
set<int> S = {-1000000000, 1000000000};
int main() {
  IO();
  int n;
  cin >> n;
  long long int ans = 1;
  int un = 0;
  int bBest = -1000000000, sBest = 1000000000;
  bool flag = 1;
  for (int i = 0; i < n; i++) {
    string s;
    int p;
    cin >> s >> p;
    if (flag)
      if (s[1] == 'D') {
        S.insert(p);
        if (p > bBest && p < sBest) un++;
      } else {
        un = 0;
        if (p < bBest || p > sBest) {
          ans = 0;
          flag = 0;
          continue;
        }
        if (p > bBest && p < sBest) {
          ans = ans << 1;
          ans %= 1000000000 + 7;
        }
        S.erase(p);
        auto it = S.lower_bound(p);
        sBest = *it;
        bBest = *(--it);
      }
  }
  ans *= un + 1;
  ans %= 1000000000 + 7;
  cout << ans << endl;
  return 0;
}
