#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 6;
const int md = 1e9 + 7;
string a[maxn];
int dp[maxn][maxn];
int pref[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < maxn; i++) {
    dp[n][i] = 1;
    pref[i] = i + 1;
  }
  for (int i = n - 1; i >= 1; i--) {
    for (int s = 0; s < maxn; s++) {
      if (a[i] == "s") {
        dp[i][s] = pref[s];
      } else {
        dp[i][s] = dp[i + 1][s + 1];
      }
    }
    pref[0] = dp[i][0];
    for (int s = 1; s < maxn; s++) {
      pref[s] = (pref[s - 1] + dp[i][s]) % md;
    }
  }
  cout << dp[1][0] << endl;
}
