#include <bits/stdc++.h>
using namespace std;
const long long ind = 1e18;
const long long maxn = 5e3 + 10;
const long long mod = 1e9 + 7;
long long dp[maxn][maxn];
int main() {
  long long n;
  cin >> n;
  dp[0][0] = 1;
  char ch = 's';
  for (long long i = 1; i <= n; i++) {
    if (ch == 's') {
      dp[i][n] = dp[i - 1][n];
      for (long long j = n - 1; j >= 0; j--)
        dp[i][j] = (dp[i - 1][j] + dp[i][j + 1]) % mod;
    }
    if (ch == 'f') {
      for (long long j = n; j >= 1; j--) {
        dp[i][j] = dp[i - 1][j - 1] % mod;
      }
    }
    cin >> ch;
  }
  long long sum = 0;
  for (long long i = 0; i <= n; i++) {
    sum += dp[n][i];
    sum %= mod;
  }
  cout << sum;
  return 0;
}
