#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll Mod=1e9+7;
int n;
ll f[3010][3010],g[3010][3010];
char s[3010];
int main()
{
	scanf("%d",&n);
	scanf("%s",s+1);
	f[1][1]=g[1][1]=1;
	for (int i=2;i<=n;i++)
	{
		for (int j=1;j<=i;j++)
		{
			if (s[i-1]=='<')
			{
				f[i][j]=g[i-1][j-1];
			}
			else
			{
				f[i][j]=(g[i-1][i-1]-g[i-1][j-1]+Mod)%Mod;
			}
			g[i][j]=(g[i][j-1]+f[i][j])%Mod;
		}
	}
	cout<<g[n][n]<<endl;
	return 0;
}
