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