#include <bits/stdc++.h>
using namespace std;
int dp[5005][5005];
int main() {
  int n;
  while (cin >> n) {
    char ch;
    memset(dp, 0, sizeof(dp));
    dp[1][0] = 1;
    for (int i = 1; i <= n; i++) {
      cin >> ch;
      if (ch == 'f') {
        for (int j = 0; j <= n; j++) dp[i + 1][j + 1] = dp[i][j];
      } else {
        long long sum = 0;
        for (int j = n; j >= 0; j--) {
          sum = sum + dp[i][j];
          sum %= 1000000007;
          dp[i + 1][j] = sum;
        }
      }
    }
    long long ans = 0;
    for (int j = 0; j <= n; j++) {
      ans = ans + dp[n][j];
      ans = ans % 1000000007;
    }
    cout << ans << endl;
  }
  return 0;
}
