#include <bits/stdc++.h>
using namespace std;
long long dp[5001][5001];
vector<char> vec;
int main() {
  long long n;
  cin >> n;
  long long md = pow(10, 9) + 7;
  char ch;
  for (long long i = 0; i < n; ++i) {
    cin >> ch;
    vec.push_back(ch);
  }
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  long long cnt = 0;
  for (long long i = 1; i < n; ++i) {
    if (vec[i - 1] == 's') {
      for (int j = cnt; j >= 0; j--)
        dp[i][j] = ((dp[i - 1][j] + dp[i][j + 1]) % md);
    } else {
      for (long long j = 1; j < cnt + 2; ++j)
        dp[i][j] = (dp[i - 1][j - 1]) % md;
      cnt++;
    }
  }
  long long sum = 0;
  for (long long i = 0; i < cnt + 1; ++i) sum += ((dp[n - 1][i]) % md);
  cout << sum % md << endl;
}
