#include <bits/stdc++.h>
using namespace std;
long long n, dp[5004][5004];
char arr[5004];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= 5002; i++) {
    dp[n][i] = 1;
    dp[n][i] += dp[n][i - 1];
    dp[n][i] %= 1000000007;
  }
  for (int i = n - 1; i >= 1; i--) {
    for (int dep = 1; dep <= n + 3; dep++) {
      dp[i][dep] = dp[i][dep - 1];
      if (arr[i] == 's') {
        dp[i][dep] += dp[i + 1][dep];
        dp[i][dep] %= 1000000007;
      } else {
        dp[i][dep] += dp[i + 1][dep + 1];
        dp[i][dep] -= dp[i + 1][dep];
        while (dp[i][dep] < 0) dp[i][dep] += 1000000007;
        dp[i][dep] %= 1000000007;
      }
    }
  }
  cout << dp[1][1];
  return 0;
}
