#include <bits/stdc++.h>
using namespace std;

const int N=3005,zqm=1e9+7;
int f[N],pre[N],suf[N];
char str[N];

int main() {
	//freopen("1.in","r",stdin);
	//freopen("1.ans","w",stdout);
	
	int n; scanf("%d",&n);
	scanf("%s",str+2);
	suf[1]=1; fill(pre+1,pre+n+1,1);
	for(int i=2;i<=n;++i) {
		if(str[i]=='<')
			for(int j=1;j<=i;++j) (f[j]+=pre[j-1])%=zqm;
		else
			for(int j=1;j<=i;++j) (f[j]+=suf[j])%=zqm;
		for(int j=1;j<=n;++j) pre[j]=(pre[j-1]+f[j])%zqm;
		for(int j=n;j>=1;--j) suf[j]=(suf[j+1]+f[j])%zqm;
		memset(f,0,sizeof(int)*(n+5));
	}
	printf("%d\n",pre[n]);
	
	return 0;
}
