#include<bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long u[3333][3333];
int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    s = '&' +s;
    u[1][1] = 1;
    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= i; j++){
            if(s[i - 1] == '<')
                u[i][j] = (u[i][j - 1] + u[i - 1][j - 1]) % mod;
            else
                u[i][j] = (u[i][j - 1] + u[i - 1][i - 1] - u[i - 1][j -1] + mod) % mod;
        }
    }
    cout << u[n][n] << endl;
}
