#include <bits/stdc++.h>

#define N_MAX 3002
#define ll long long

using namespace std;

const ll MOD = 1e9+7;

int n;

string s;

ll dp[N_MAX][N_MAX];
ll sdp[N_MAX][N_MAX];

int main()
{
    cin >> n;
    cin >> s;
    sdp[1][1] = 1;
    for(int i = 2; i <= n; i++)
        for(int j = 1; j <= i; j++)
        {
            if(s[i - 2] == '<')
                dp[i][j] = sdp[i - 1][j - 1];
            else
                dp[i][j] = (sdp[i - 1][i - 1] - sdp[i - 1][j - 1] + MOD) % MOD;
            sdp[i][j] = sdp[i][j - 1] + dp[i][j];
            if(sdp[i][j] >= MOD)
                sdp[i][j] -= MOD;
        }
    cout << sdp[n][n] << "\n";
    return 0;
}
