#if 1

#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int d[3005][3005],n;
char a[3005];

int main()
{
    cin >> n >> a;
	d[0][0] = 1;
	for(int i = 1;i < n;i++)
	{
		for(int j = 0;j <= i;j++)
		{
			if(a[i-1] == '<') d[i][j] = (d[i-1][0]-d[i-1][j]+mod)%mod;
			else d[i][j] = d[i-1][j];
		}
		for(int j = i;j >= 0;j--) 
        {
            d[i][j] = (d[i][j]+d[i][j+1])%mod;
        }
    }
	cout << d[n-1][0];
}

#endif // 1