#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 5e3 + 10;
int f[2][maxn][2], g[2][maxn][2];
char s[maxn];
int Mod(int x) {
  while (x >= mod) x -= mod;
  while (x < 0) x += mod;
  return x;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%s", s + i);
  f[0][1][0] = g[0][1][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      if (s[i] == 's')
        f[i & 1][j][0] = Mod(g[i & 1 ^ 1][j][0] + f[i & 1 ^ 1][j - 1][1]);
      else
        f[i & 1][j][1] = Mod(g[i & 1 ^ 1][j][0] + f[i & 1 ^ 1][j - 1][1]);
    }
    for (int j = i; j; j--)
      g[i & 1][j][0] = Mod(g[i & 1][j + 1][0] + f[i & 1][j][0]),
            g[i & 1][j][1] = Mod(g[i & 1][j + 1][1] + f[i & 1][j][1]);
    memset(g[i & 1 ^ 1], 0, sizeof(g[i & 1 ^ 1]));
    memset(f[i & 1 ^ 1], 0, sizeof(f[i & 1 ^ 1]));
  }
  int ans = g[n & 1][1][0];
  printf("%d\n", ans);
}
