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