#include <bits/stdc++.h>
using namespace std;
int n;
bool s[5010];
int f[5010][5010];
int main() {
  char ch;
  int i, j;
  scanf("%d\n", &n);
  for (i = 0; i < n; i++) {
    scanf("%c\n", &ch);
    if (ch == 'f')
      s[i] = 1;
    else
      s[i] = 0;
  }
  for (i = 0; i < n; i++) f[n - 1][i] = i + 1;
  for (i = n - 2; i >= 0; i--)
    for (j = 0; j <= i; j++) {
      if (s[i])
        f[i][j] = (f[i + 1][j + 1] - f[i + 1][j] + 1000000007) % 1000000007;
      else
        f[i][j] = f[i + 1][j];
      if (j) f[i][j] = (f[i][j] + f[i][j - 1]) % 1000000007;
    }
  printf("%d", f[0][0]);
}
