#include <bits/stdc++.h>
#define mk make_pair
using namespace std;
typedef long long ll;
const int N = 3e5;
const int mod = 1e9 + 7;
int n;
char str[N];
int dp[3003][3003], s[3003];
int main() {
	cin >> n;
	scanf("%s", str + 2);
	dp[1][1] = 1;
	for (int i = 2; i <= n; ++i) {
		for (int j = 1; j < i; ++j) 
			s[j] = (s[j - 1] + dp[i - 1][j]) % mod; 
		s[i] = s[i - 1];
		for (int j = 1; j <= n; ++j) {
			if (str[i] == '<') {
				dp[i][j] = s[j - 1];
			} else {
				dp[i][j] = (s[i - 1] - s[j - 1] + mod) % mod;
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; ++i) (ans += dp[n][i]) %= mod;
	cout << ans;
}

