#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 10;
const int inf = 1e9;
const int mod = 1e9 + 7;
string s;
int n;
int dp[N][N];
int dp_func(int pos, int rem) {
  if (pos == n) return rem == 0;
  if (dp[pos][rem] != -1) return dp[pos][rem];
  if (s[pos] == 'f') {
    return dp[pos][rem] = dp_func(pos + 1, rem + 1);
  }
  int ret = 0;
  if (rem) ret += dp_func(pos, rem - 1);
  ret += dp_func(pos + 1, rem);
  ret %= mod;
  return dp[pos][rem] = ret;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    string t;
    cin >> t;
    s += t;
  }
  memset(dp, -1, sizeof(dp));
  int ans = dp_func(0, 0);
  cout << ans << '\n';
  return 0;
}
