#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int m = 0;
int block[5005];
long long f[5005];
int main() {
  int n, tmp;
  int num_of_for = 0;
  cin >> n;
  tmp = n;
  while (tmp--) {
    char c;
    cin >> c;
    if (c == 's') {
      block[m] = num_of_for;
      num_of_for = 0;
      m++;
    } else {
      num_of_for++;
    }
  }
  for (int k = 0; k < n; k++) {
    f[k] = 1;
  }
  for (int i = m - 1; i >= 0; i--) {
    f[0] = f[block[i]];
    for (int k = 1; k < n; k++) {
      if (block[i] + k < n) {
        f[k] = f[k - 1] + f[block[i] + k];
      } else {
        f[k] = f[k - 1];
      }
      f[k] %= mod;
    }
  }
  cout << (f[0] + mod) % mod;
  return 0;
}
