#include <cstdio>
using namespace std;
int n;
char cond[3005];
long long arr[3005],pre[3005];
const long long mod=1000000007;
int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for (int x=1;x<=n;x++) cond[x]=getchar();
    arr[1]=1;
    for (int x=1;x<=n;x++) pre[x]=1;
    for (int x=2;x<=n;x++){
        for (int y=1;y<=x;y++){
            if (cond[x]=='<') arr[y]=pre[y-1];
            else arr[y]=(pre[n]-pre[y-1]+mod)%mod;
        }
        for (int y=1;y<=n;y++) pre[y]=(pre[y-1]+arr[y])%mod;
        //for (int y=1;y<=n;y++) printf("%d ",arr[y]);
        //printf("\n");
    }
    printf("%d\n",pre[n]);
}
