#include <bits/stdc++.h>
using namespace std;
int n, *dp[5001], *sum[5001];
char s[5001];
int fun(int pos, int level) {
  if (dp[pos][level]) return dp[pos][level];
  if (pos == n) {
    dp[pos][level] = 1;
    return 1;
  }
  int ans = 0;
  if (s[pos] == 'f')
    ans = fun(pos + 1, level + 1);
  else
    ans = sum[pos + 1][level];
  dp[pos][level] = ans;
  return ans;
}
int main() {
  int i, j;
  scanf("%d\n", &n);
  for (i = 1; i <= n; i++) {
    scanf("%c\n", &s[i]);
    dp[i] = (int*)calloc(i + 1, sizeof(int));
    sum[i] = (int*)calloc(i + 1, sizeof(int));
  }
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  for (i = n; i >= 1; i--) {
    sum[i][0] = fun(i, 0);
    for (j = 1; j <= i; j++) {
      sum[i][j] = sum[i][j - 1] + fun(i, j);
      sum[i][j] %= 1000000007;
    }
  }
  printf("%d\n", dp[1][0]);
  return 0;
}
