#include <bits/stdc++.h>
using namespace std;
long long n;
long long m, k;
long long mod = 1e9 + 7;
vector<long long> ar;
vector<long long> graph[5001];
vector<pair<long long, long long> > travel;
int D[5001], tin[5001], tout[5001];
vector<pair<long long, long long> > stree[4 * 5001];
long long tag[5001][5001];
int ch[26];
int num[26];
string s[2501];
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cin >> n;
  string curr, prev = "";
  long long presumprev = 0, presumcurr = 0;
  for (int i = 0; i < n; i++) {
    cin >> curr;
    presumcurr = 0;
    if (i) {
      if (prev == "f") {
        for (int j = 0; j < 5001; j++) tag[i][j + 1] = tag[i - 1][j];
        presumcurr = presumprev;
      } else {
        for (int j = 0; j < 5001; j++) {
          if (j == 0) {
            tag[i][j] = presumprev;
            presumcurr = (presumcurr + tag[i][j]) % mod;
          } else if (presumprev - tag[i - 1][j - 1] >= 0) {
            presumprev -= tag[i - 1][j - 1];
            tag[i][j] = presumprev;
            presumcurr = (presumcurr + tag[i][j]) % mod;
          } else {
            tag[i][j] = presumprev + mod - tag[i - 1][j - 1];
            presumprev = tag[i][j];
            presumcurr = (presumcurr + tag[i][j]) % mod;
          }
        }
      }
    } else
      tag[i][0] = 1, presumcurr = 1;
    prev = curr;
    presumprev = presumcurr;
  }
  cout << presumprev;
  return 0;
}
