#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;
int dp[5000 + 5];
int32_t main() {
  int n;
  cin >> n;
  vector<string> prog(n);
  for (int i = 0; i < n; i++) {
    cin >> prog[i];
  }
  memset(dp, 0, sizeof(dp));
  ;
  for (int d = 0; d <= n; d++) dp[d] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (prog[i] == "f") {
      for (int d = 0; d <= i; d++) {
        dp[d] = dp[d + 1];
      }
    } else {
      for (int d = 1; d <= i; d++) dp[d] = (dp[d] + dp[d - 1]) % MOD;
    }
  }
  cout << dp[0] << endl;
  return 0;
}
