#include <bits/stdc++.h>
using namespace std;
const int maxn = 5009;
const long long mod = 1e9 + 7;
int dp[maxn][maxn];
int main() {
  int n;
  cin >> n;
  char s;
  dp[1][0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s == 'f') {
      for (int j = 0; j < n; j++) dp[i + 1][j + 1] = dp[i][j];
    } else {
      long long sumn = 0;
      for (int j = n - 1; j >= 0; j--) {
        sumn = (sumn + dp[i][j]) % mod;
        dp[i + 1][j] = sumn;
      }
    }
  }
  long long sumn = 0;
  for (int j = 0; j < n; j++) sumn = (sumn + dp[n][j]) % mod;
  cout << sumn << endl;
  return 0;
}
