#include <iostream>
using namespace std;
typedef long long ll;

int N;
string S;
ll dp[3010][3010] = {},inf = 1e9+7;

int main(){
	cin >> N >> S;
	dp[1][1] = 1;
	for(int i=2;i<=N;i++){
		for(int j=1;j<=i;j++){
			if(S[i-2]=='<'){
				if(j!=1) dp[i][j] = dp[i-1][j-1];
			}else{
				if(j!=i) dp[i][j] = (dp[i-1][i-1]-dp[i-1][j-1]+inf)%inf;		
			}
		}
		for(int j=1;j<=i;j++){
			(dp[i][j] += dp[i][j-1])%=inf;
		}
	}
	cout << dp[N][N] << endl;
}