// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int maxn = 3005, mod = 1e9+7;
int N, dp[maxn][maxn], sum[maxn][maxn];
string s;

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>N>>s;
    
    dp[1][1] =1;
    sum[1][1] = 1;
    for(int i = 2; i <= N; i++){
        for(int j = 1; j<= i; j++){
            if(s[i-2] == '<')(dp[i][j] = sum[i-1][j-1])%=mod;
            else (dp[i][j] = sum[i-1][i-1] - sum[i-1][j-1]+mod)%=mod;
        }
        for(int j = 1;j<=i; j++)(sum[i][j] = sum[i][j-1] + dp[i][j])%=mod;
    }
    cout<<sum[N][N]<<endl;
    
    return 0;
}

