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