#include <bits/stdc++.h>
using namespace std;
namespace mytl {
template <typename T, typename P>
T power(T base, P exponential, T unit) {
  T res = unit;
  while (exponential > 0) {
    if (exponential % 2 == P(1)) res = res * base;
    base = base * base;
    exponential = exponential / 2;
  }
  return res;
}
}  // namespace mytl
using ll = long long;
namespace mytl {
template <ll MOD>
struct TSModulo {
 private:
  ll val;

 public:
  static TSModulo unit() { return 1; }
  static TSModulo inverse(TSModulo x) { return power(x, MOD - 2, unit()); };
  TSModulo(ll initVal) {
    initVal %= MOD;
    if (val < 0) initVal += MOD;
    val = initVal;
  };
  TSModulo& operator=(const TSModulo&) = default;
  ll get() const { return val; }
  TSModulo operator-() const { return TSModulo(-val); };
  TSModulo operator+() const { return TSModulo(+val); };
  TSModulo operator-(const ll& operand) const {
    return TSModulo(val - operand);
  };
  TSModulo operator+(const ll& operand) const {
    return TSModulo(val + operand);
  };
  TSModulo operator*(const ll& operand) const {
    return TSModulo(val * operand);
  };
  TSModulo operator/(const ll& operand) const {
    return TSModulo(inverse(operand) * val);
  };
  TSModulo operator-(const TSModulo& operand) const {
    return TSModulo(val - operand.get());
  };
  TSModulo operator+(const TSModulo& operand) const {
    return TSModulo(val + operand.get());
  };
  TSModulo operator*(const TSModulo& operand) const {
    return TSModulo(val * operand.get());
  };
  TSModulo operator/(const TSModulo& operand) const {
    return TSModulo(val * inverse(operand));
  };
};
using Mod107 = TSModulo<1000000007LL>;
template <ll MOD>
ostream& operator<<(ostream& os, TSModulo<MOD> x) {
  return os << "(" << x.get() << "%" << MOD << ")";
}
}  // namespace mytl
using namespace mytl;
ll latest = 0;
struct Node {
  Mod107 d = 0;
  ll friss = 0;
};
Mod107 get_from(Node& node) {
  if (latest > node.friss)
    return 0;
  else
    return node.d;
}
void update(Node& node, Mod107 val) {
  node.friss = latest;
  node.d = val;
}
void nullaz() { latest++; }
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  ll n;
  cin >> n;
  map<ll, Node> nodok;
  nodok[0].d = 1;
  nodok[1000000000LL].d = 0;
  for (ll i = 1; i <= n; i++) {
    string szo;
    ll val;
    cin >> szo >> val;
    if (szo == "ADD") {
      nodok[val].d = 0;
      nodok[val].d = get_from(prev(nodok.find(val))->second);
      nodok[val].friss = latest;
    } else {
      auto talal = prev(nodok.find(val));
      talal->second.d = get_from(talal->second) + get_from(nodok[val]);
      talal->second.friss = latest + 1;
      nodok.erase(val);
      latest++;
    }
  }
  Mod107 res = 0;
  for (auto& par : nodok) {
    res = res + get_from(par.second);
  }
  cout << res.get() << flush;
}
