#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<int> > a(2, vector<int>(n, 0));
  a[0][0] = 1;
  char pre = '0';
  int mod = 1000000007;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (pre == 'f') {
      for (int j = 0; j < n - 1; j++) {
        a[(i + 1) % 2][j + 1] = a[i % 2][j];
        a[(i + 1) % 2][j + 1] %= mod;
      }
    } else {
      a[(i + 1) % 2][n - 1] = a[i % 2][n - 1];
      for (int j = n - 2; j >= 0; j--) {
        a[(i + 1) % 2][j] = a[(i + 1) % 2][j + 1] + a[i % 2][j];
        a[(i + 1) % 2][j] %= mod;
      }
    }
    for (int j = 0; j < n; j++) {
      a[i % 2][j] = 0;
    }
    pre = c;
  }
  int answer = 0;
  for (int i = 0; i < n; i++) {
    answer += a[n % 2][i];
    answer %= mod;
  }
  cout << answer;
  return 0;
}
