#include <bits/stdc++.h>
using namespace std;
template <class T>
void mxi(T &a, const T &b) {
  a = max(a, b);
}
template <class T>
void mni(T &a, const T &b) {
  a = min(a, b);
}
long double EPS = 1e-9;
long long dp[5005][5005];
long long ar[5005], n;
long long go(long long k, long long id) {
  if (id == n && k == 0)
    return 1;
  else if (id == n)
    return 0;
  long long &e = dp[k][id];
  if (e == -1) {
    e = 0;
    if (k) {
      if (ar[id] == 2) {
        e = go(k + 1, id + 1);
      } else {
        e = go(k - 1, id);
        e = (e + go(k, id + 1)) % 1000000007;
      }
    } else {
      if (ar[id] == 1)
        e = go(k, id + 1);
      else
        e = go(k + 1, id + 1);
    }
  }
  return e;
}
void solve() {
  memset(dp, -1, sizeof(dp));
  cin >> n;
  for (long long i = 0; i < (n); i++) {
    char ch;
    cin >> ch;
    if (ch == 's')
      ar[i] = 1;
    else
      ar[i] = 2;
  }
  cout << go(0, 0) << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, tab;
  t = 1;
  tab = t;
  while (t--) {
    solve();
  }
}
