#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  ll mod = 1e9+7;

  vector<ll> dp(n,0);
  dp[0] = 1;
  for (int i = n-2; i >= 0; i--) {
    vector<ll> ndp(n,0);
    if (s[i] == '>') {
      ll acc = 0;
      for (int j = 0; j < n-i; j++) {
	ndp[j] = acc;
	(acc += dp[j]) %= mod;
      }
    } else {
      ll acc = 0;
      for (int j = n-1; j >= 0; j--) {
	(acc += dp[j]) %= mod;
	ndp[j] = acc;
      }
    }
    swap(ndp,dp);
  }
  ll ans = 0;
  for (int i = 0; i < n; i++)
    (ans += dp[i]) %= mod;
  cout << ans << endl;
}
