#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long mod = 1e9 + 7;
int n, ans, ct;
char ch[5005];
long long dp[5005][5005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ch[i];
  }
  dp[1][0] = 1;
  for (int i = 1; i <= n; i++) {
    if (ch[i] == 'f') {
      for (int j = 1; j <= n; j++) {
        dp[i + 1][j] = dp[i][j - 1];
      }
    } else {
      int rs = 0;
      for (int j = n; j >= 0; j--) {
        rs += dp[i][j];
        rs %= mod;
        dp[i + 1][j] = rs;
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    ans += dp[n][i];
    ans %= mod;
  }
  cout << ans;
}
