#include <iostream>
#include <algorithm>
using namespace std;
int n, d[3003][3003], mod = 1000000007;
string s;
int main() {
    cin >> n >> s;
    for (int i = 1; i <= n; i++) d[1][i] = 1;
    for (int i = 2; i <= n; i++) {
        if (s[i - 2] == '<') {
            for (int j = 1; j <= n - i + 1; j++) {
                d[i][j] = (d[i][j - 1] + d[i - 1][j]) % mod;
            }
        } else {
            for (int j = n - i + 1; j; j--) {
                d[i][j] = (d[i][j + 1] + d[i - 1][j + 1]) % mod;
            }
        }
    }
    cout << d[n][1] << '\n';
}

/*
 d[i][j]=d[i][j-1]+d[i-1][j]
 d[i][j]=d[i][j+1]+d[i-1][j+1]
 d[i][j+1]=d[i-1][n-i+1]+d[i-1][n-i]+...
 */
