#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n;
long long dt[5010][5010];
long long ans;
char c, last;
int main() {
  cin >> n;
  dt[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> c;
    if (last == 'f')
      for (int j = 0; j < n; j++) dt[i][j] = dt[i - 1][j - 1];
    else
      for (int j = n - 1; j >= 0; j--)
        dt[i][j] = (dt[i][j + 1] + dt[i - 1][j]) % MOD;
    last = c;
  }
  for (int i = 0; i < n; i++) ans = (ans + dt[n][i]) % MOD;
  cout << ans;
}
