#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5010;
const int mod = 1e9 + 7;
int add(int a, int b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
  return a;
}
int mult(int a, int b) { return (long long)a * b % mod; }
int dp[MAXN][MAXN];
char com[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  dp[0][1] = 1;
  com[0] = 's';
  for (int i = 1; i <= n; i++) {
    cin >> com[i];
    int t = 0;
    for (int c = n + 2; c > 0; c--) {
      t = add(t, dp[i - 1][c]);
      if (com[i - 1] == 's') {
        dp[i][c] = t;
      } else {
        dp[i][c] = dp[i - 1][c - 1];
      }
    }
  }
  int sol = 0;
  for (int c = n + 2; c > 0; c--) {
    sol = add(sol, dp[n][c]);
  }
  cout << sol << '\n';
}
