#include <bits/stdc++.h>
using namespace std;
int N;
set<int> cur;
vector<int> v;
map<int, int> id;
pair<string, int> arr[400011];
struct segtree {
  int st[4 * 400011], lazy[4 * 400011];
  void push(int w, int L, int R) {
    if (lazy[w] < 0)
      return;
    else if (L != R) {
      lazy[w * 2] = lazy[w];
      lazy[w * 2 + 1] = lazy[w];
    }
    st[w] = ((R - L + 1) * lazy[w]) % 1000000007;
    lazy[w] = -1;
  }
  void update(int w, int L, int R, int a, int b, int v) {
    push(w, L, R);
    if (b < L || a > R)
      return;
    else if (a <= L && b >= R) {
      lazy[w] = v;
      push(w, L, R);
    } else {
      update(w * 2, L, (L + R) / 2, a, b, v);
      update(w * 2 + 1, (L + R) / 2 + 1, R, a, b, v);
      st[w] = (st[w * 2] + st[w * 2 + 1]) -
              ((st[w * 2] + st[w * 2 + 1]) / 1000000007) * 1000000007;
    }
  }
  int query(int w, int L, int R, int a, int b) {
    push(w, L, R);
    if (b < L || a > R)
      return 0;
    else if (a <= L && b >= R)
      return st[w];
    else {
      int q1 = query(w * 2, L, (L + R) / 2, a, b);
      int q2 = query(w * 2 + 1, (L + R) / 2 + 1, R, a, b);
      return (q1 + q2) - ((q1 + q2) / 1000000007) * 1000000007;
    }
  }
} tree;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> arr[i].first;
    cin >> arr[i].second;
    if (arr[i].first == "ADD") v.push_back(arr[i].second);
  }
  v.push_back(1000000007);
  v.push_back(-1000000007);
  sort(v.begin(), v.end());
  memset(tree.lazy, -1, sizeof(tree.lazy));
  for (int i = 0; i < (int)v.size(); i++) id[v[i]] = i + 1;
  cur.insert(1000000007);
  cur.insert(-1000000007);
  tree.update(1, 1, v.size(), 1, 1, 1);
  for (int i = 0; i < N; i++) {
    int cid = id[arr[i].second];
    int prv = *--cur.lower_bound(arr[i].second);
    if (arr[i].first == "ADD") {
      tree.update(1, 1, v.size(), cid, cid,
                  tree.query(1, 1, v.size(), id[prv], id[prv]));
      cur.insert(arr[i].second);
    } else {
      tree.update(1, 1, v.size(), 1, id[prv] - 1, 0);
      tree.update(1, 1, v.size(), cid + 1, v.size(), 0);
      int nval = (tree.query(1, 1, v.size(), id[prv], id[prv]) +
                  tree.query(1, 1, v.size(), cid, cid));
      tree.update(1, 1, v.size(), id[prv], id[prv], nval % 1000000007);
      tree.update(1, 1, v.size(), cid, cid, 0);
      cur.erase(arr[i].second);
    }
  }
  cout << tree.query(1, 1, v.size(), 1, v.size()) << endl;
}
