#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
const int N = 5001;
long long dp[N][N];
int n;
bool arr[N];
long long solve(int idx, int lvl) {
  if (lvl < 0) return 0;
  if (idx == n) return 1;
  long long &ret = dp[idx][lvl];
  if (~ret) return ret;
  ret = 0;
  if (lvl && !arr[idx - 1]) ret = solve(idx, lvl - 1) % mod;
  return ret = (ret + solve(idx + 1, lvl + arr[idx]) % mod) % mod;
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    char c;
    scanf(" %c", &c);
    arr[i] = (c == 'f');
  }
  printf("%lld", solve(0, 0));
  return 0;
}
