#include <bits/stdc++.h>
using namespace std;
int N, Z, A[5000], i, j;
char C;
int main() {
  cin >> N;
  Z = A[0] = 1;
  for (i = 0; i < N; i++) {
    cin >> C;
    if (C == 'f') {
      Z++;
    } else {
      for (j = 1; j < Z; j++) {
        A[j] = (A[j] + A[j - 1]) % 1000000007;
      }
    }
  }
  cout << A[Z - 1] << '\n';
}
