#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int sum = 0, dp[n];
  memset(dp, 0, sizeof(dp));
  sum = 1;
  dp[0] = 1;
  char ch;
  for (int i = 0; i < n; i++) {
    cin >> ch;
    if (ch == 'f')
      sum++;
    else {
      for (int j = 1; j < sum; j++) {
        dp[j] = (dp[j] + dp[j - 1]) % mod;
      }
    }
  }
  cout << dp[sum - 1] << endl;
}
