#include <bits/stdc++.h>
using namespace std;
int n;
const long long int mod = 1e9 + 7;
char s[5010];
long long int dp[5010][5010];
long long int solve(int ind, int nex) {
  if (nex < 0) return 0;
  if (ind > n) return 1LL;
  if (dp[ind][nex] != -1) return dp[ind][nex];
  long long int ans = solve(ind, nex - 1);
  if (s[ind] == 's')
    ans += solve(ind + 1, nex);
  else {
    ans += solve(ind + 1, nex + 1);
    ans -= solve(ind + 1, nex);
  }
  ans += mod;
  ans %= mod;
  return dp[ind][nex] = ans;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  memset(dp, -1, sizeof(dp));
  cout << solve(1, 0);
  return 0;
}
