#include <bits/stdc++.h>
const long long int mod = 1000000007;
using namespace std;
const int N = 5005;
long long int dp[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  char c;
  bool s[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> c;
    s[i] = false;
    if (c == 'f') s[i] = true;
  }
  dp[1][1] = 1;
  for (int i = 2; i <= n; i++) {
    if (s[i - 1]) {
      dp[i][1] = 0;
      for (int j = 2; j <= n; j++) dp[i][j] = dp[i - 1][j - 1];
    } else {
      dp[i][n] = dp[i - 1][n];
      long long int sum = dp[i - 1][n];
      for (int j = n - 1; j >= 1; j--) {
        sum += dp[i - 1][j];
        if (sum >= mod) sum -= mod;
        dp[i][j] = sum;
      }
    }
  }
  long long int ans = 0;
  for (int k = 1; k <= n; k++) {
    ans += dp[n][k];
    if (ans >= mod) ans -= mod;
  }
  cout << ans << endl;
  return 0;
}
