#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int n;
char s[5001];
int dp[2][5001][5001];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i <= n; i++) dp[0][n][i] = dp[1][n][i] = 1;
  for (int pos = n - 1; pos >= 0; pos--) {
    for (int level = 0; level < n; level++) {
      for (int emp = 0; emp <= 1; emp++) {
        int& ans = dp[emp][pos][level];
        ans = 0;
        if (level && !emp) ans = dp[0][pos][level - 1];
        if (s[pos] == 's') {
          ans = ans + dp[0][pos + 1][level];
          ans %= mod;
        } else {
          ans = ans + dp[1][pos + 1][level + 1];
          ans %= mod;
        }
      }
    }
  }
  printf("%d\n", dp[1][0][0]);
  return 0;
}
