#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int maxn = 5010;
long long int dp[maxn][maxn];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  char prev = 'c';
  dp[0][0] = 1;
  for (long long int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    if (prev == 'f') {
      for (long long int j = 0; j < n; j++) {
        dp[i][j + 1] = dp[i - 1][j];
      }
    } else {
      for (long long int j = n; j >= 0; j--) {
        dp[i][j] = (dp[i - 1][j] + dp[i][j + 1]) % mod;
      }
    }
    prev = c;
  }
  long long int ans = 0;
  for (long long int i = 0; i <= n; i++) {
    ans = (ans + dp[n][i]) % mod;
  }
  cout << ans << '\n';
  return 0;
}
