#include<cstdio>
#include<cstring>
#include<iostream>
const int MAXN=3010;
const int MOD=1e9+7;
int n,f[MAXN][MAXN];
int sum1[MAXN][MAXN],sum2[MAXN][MAXN];

inline bool getc(){
	char ch;std::cin>>ch;
	return ch=='<';
}
int main(){
	scanf("%d",&n);
	f[1][1]=sum1[1][1]=sum2[1][1]=1;
	for(int i=2;i<=n;i++){
		if(getc())
			for(int j=1;j<=i;j++)
				f[i][j]=sum1[i-1][j-1];
		else
			for(int j=1;j<=i;j++)
				f[i][j]=sum2[i-1][j];
		for(int j=1;j<=i;j++)
			sum1[i][j]=(sum1[i][j-1]+f[i][j])%MOD;
		for(int j=i;j>=1;j--)
			sum2[i][j]=(sum2[i][j+1]+f[i][j])%MOD;
	}
	printf("%d\n",sum1[n][n]);
	return 0;
}