#include <bits/stdc++.h>
using namespace std;
constexpr int SIZE = 5005;
constexpr int MOD = 1e9 + 7;
int dp[SIZE][SIZE];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  dp[0][0] = 1;
  char prev, act;
  cin >> prev;
  for (int i = 1; i < n; i++) {
    cin >> act;
    if (prev == 'f') {
      for (int j = 1; j <= i; j++) {
        dp[i][j] = dp[i - 1][j - 1];
      }
    } else {
      int pref = 0;
      for (int j = n; j >= 0; j--) {
        pref = (pref + dp[i - 1][j]) % MOD;
        dp[i][j] = pref;
      }
    }
    prev = act;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans = (ans + dp[n - 1][i]) % MOD;
  }
  cout << ans << "\n";
}
