#include <iostream>
using namespace std;
constexpr int MOD = 1e9 + 7;
long n, dp[3030][3030];
string s;

int main() {
  cin >> n >> s;

  dp[1][1] = 1;
  for(int i = 2; i <= n; ++i) {
    for(int j = 2; j <= n; ++j) (dp[i-1][j] += dp[i-1][j-1]) %= MOD;
    for(int now = 1; now <= i; ++now) {
      int L, R;
      if(s[i-2] == '<') L = 1, R = now - 1;
      else L = now, R = i;
      if(L <= R) (dp[i][now] += dp[i-1][R] - dp[i-1][L-1] + MOD) %= MOD;
    }
  }
  
  long ans = 0;
  for(int i = 1; i <= n; ++i) ans = (ans + dp[n][i]) % MOD;
  cout << ans;
  return 0;
}
