#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
bool umin(T1& x, const T2& y) {
  return (x > y ? (x = y, true) : false);
}
template <typename T1, typename T2>
bool umax(T1& x, const T2& y) {
  return (x < y ? (x = y, true) : false);
}
template <typename T>
void read(T& x) {
  cin >> x;
  return;
  char ch;
  T p = 1;
  x = 0;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') p = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= p;
}
void read(string& x) {
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  while (ch > ' ') x += ch, ch = getchar();
}
void read(char& x) {
  do {
    x = getchar();
  } while (x <= ' ');
}
template <typename T, typename... R>
void read(T& x, R&... y) {
  read(x);
  read(y...);
}
const int N = (int)5e3 + 3;
const int INF = (int)1e9 + 17;
const long long mod = (long long)1e9 + 7;
const long long LLINF = (long long)1e18 + 17;
const long double pi = (long double)acos(-1.0);
int n, m;
char c[N];
int dp[N][N];
int main() {
  read(n);
  for (int i = (0); i < (n); i++) read(c[i]);
  dp[0][0] = 1;
  for (int i = (1); i < (n); i++) {
    for (int j = (1); j < (n); j++) {
      if (c[i - 1] == 'f') dp[i][j] += dp[i - 1][j - 1];
      dp[i][j] %= mod;
    }
    long long sum = 0;
    for (int j = (n)-1; j >= (0); --j) {
      sum += dp[i - 1][j];
      if (c[i - 1] != 'f') dp[i][j] += sum;
      sum %= mod;
      dp[i][j] %= mod;
    }
  }
  long long sum = 0;
  for (int i = (0); i < (n); i++) sum = (sum + dp[n - 1][i]) % mod;
  printf("%I64d\n", sum);
  return 0;
}
