#include <bits/stdc++.h>
using namespace std;
bool cmp(long long int a, long long int b) {
  if (a > b) return true;
  return false;
}
inline long long int power(long long int n, long long int p, long long int k) {
  long long int x = 1;
  while (p) {
    if (p % 2) x = (x * n) % k;
    if (p /= 2) n = (n * n) % k;
  }
  return x;
}
long long int n, dp[2][5010], res;
char c, pre;
int main() {
  int t = 1;
  pre = 's';
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      getchar();
      c = getchar();
      if (i == 0) {
        dp[0][0] = 1;
      } else {
        if (pre == 'f') {
          dp[i % 2][0] = 0;
          for (int j = 0; j < n; j++) {
            dp[i % 2][j + 1] = dp[(i + 1) % 2][j];
          }
        } else {
          for (int j = n; j >= 0; j--) {
            dp[i % 2][j] = (dp[i % 2][j + 1] + dp[(i + 1) % 2][j]) % 1000000007;
          }
        }
      }
      pre = c;
    }
    for (int i = 0; i < n + 1; i++) {
      res = (res + dp[(n + 1) % 2][i]) % 1000000007;
    }
    cout << res << '\n';
  }
  return 0;
}
