#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 5e3 + 5;
int tab[MAXN];
vector<int> G[MAXN];
queue<int> Q;
stack<int> St;
set<int> S;
map<int, int> M;
vector<string> V;
bool cmp(string a, string b) {
  for (int i = 0; i < min(a.size(), b.size()); i++) {
    if (a[i] > b[i]) return 0;
    if (a[i] < b[i]) return 1;
  }
  return a.size() < b.size();
}
int mod = 1e9 + 7, dp[MAXN][MAXN];
int main() {
  int n;
  cin >> n;
  dp[0][0] = 1;
  string s = "f";
  int f = 1;
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    s += c;
    if (s[i - 1] == 'f') {
      for (int k = f; k > 0; k--) {
        dp[i][k] = dp[i - 1][k - 1];
      }
    } else {
      for (int k = f; k > 0; k--) {
        dp[i][k] = ((dp[i][k] + dp[i][k + 1]) % mod + dp[i - 1][k]) % mod;
      }
    }
    f += (c == 'f');
  }
  int res = 0;
  for (int i = 0; i <= f; i++) {
    res = (res + dp[n][i]) % mod;
  }
  cout << res << "\n";
}
