#include <bits/stdc++.h>
using namespace std;
int N;
unsigned long long DP[2][5005];
unsigned long long psum[5005];
char a[5005];
unsigned long long dp() {
  DP[1][0] = 1;
  psum[0] = 1;
  for (int i = 2; i <= N; i++) {
    unsigned long long cur_level_tot = 0;
    if (a[i - 1] == 'f') {
      DP[i % 2][0] = 0;
      for (int j = 1; j <= i - 1; j++) DP[i % 2][j] = DP[(i - 1) % 2][j - 1];
    } else {
      for (int j = 0; j <= i - 1; j++) DP[i % 2][j] = psum[j];
    }
    psum[i - 1] = DP[i % 2][i - 1] % 1000000007;
    for (int j = i - 2; j >= 0; j--)
      psum[j] = (DP[i % 2][j] + psum[j + 1]) % 1000000007;
  }
  unsigned long long tot = 0;
  for (int i = 0; i <= N - 1; i++) tot = (tot + DP[N % 2][i]) % 1000000007;
  return tot;
}
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> a[i];
  cout << dp() << '\n';
  return 0;
}
