#include <bits/stdc++.h>
using namespace std;
long long dp[5005][5005], n, bagi = 1e9 + 7;
char c[5005];
long long f(long long idx, long long y) {
  if (idx == n) {
    return 1;
  } else if (y < 1) {
    return 0;
  } else if (dp[idx][y] == -1) {
    if (c[idx] == 'f') {
      dp[idx][y] = (f(idx + 1, y + 1)) % bagi;
    } else {
      dp[idx][y] = (f(idx + 1, y) + f(idx, y - 1)) % bagi;
    }
  }
  return dp[idx][y];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> c[i];
  }
  memset(dp, -1, sizeof(dp));
  cout << f(1, 1) % bagi << '\n';
  return 0;
}
