#include<iostream>
#include<vector>
#define int long long
using namespace std;
const int N=3005;
const int mod=1e9+7;
int dp[N][N],sum[N][N];
signed main(){
	int n,i,j;
	string s;
	cin>>n>>s;
	dp[1][1]=1;
	sum[1][1]=1;
	for(i=2;i<=n;i++){
		for(j=1;j<=i;j++){
			if(s[i-2]=='<'){
				dp[i][j]=sum[i-1][j-1];
			}
			else{
				dp[i][j]=((sum[i-1][i-1]-sum[i-1][j-1])%mod+mod)%mod;
			}
			sum[i][j]=(sum[i][j-1]+dp[i][j])%mod;
		}
	}
	cout<<sum[n][n];
}