#include <bits/stdc++.h>
#define ll long long int
#define ld long double
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
using namespace std;

struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%MOD+MOD)%MOD){}
  // mint(ll x):x(x){}
  mint& fix() { x = (x%MOD+MOD)%MOD; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint operator~() const { return mint(1) / *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=MOD) x-=MOD; return *this;}
  mint& operator+=(const int& a){ if((x+=a)>=MOD) x-=MOD; return *this;}
  mint& operator+=(const ll& a){ if((x+=a)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const mint& a){ if((x+=MOD-a.x)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const ll& a){ if((x+=MOD-a)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const int& a){ if((x+=MOD-a)>=MOD) x-=MOD; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=MOD; return *this;}
  mint& operator*=(const ll& a){ (x*=a)%=MOD; return *this;}
  mint& operator*=(const int& a){ (x*=a)%=MOD; return *this;}
  mint& operator/=(const mint& a){ (x*=a.ex(MOD-2).x)%=MOD; return *this;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator+(const ll& a)const{ return mint(*this) += mint(a);}
  mint operator+(const int& a)const{ return mint(*this) += mint(a);}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator-(const ll& a)const{ return mint(*this) -= mint(a);}
  mint operator-(const int& a)const{ return mint(*this) -= mint(a);}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  mint operator*(const ll& a)const{ return mint(*this) *= mint(a);}
  mint operator*(const int& a)const{ return mint(*this) *= mint(a);}
  mint operator/(const mint& a)const{ return mint(*this) /= a;}
  mint operator/(const ll& a)const{ return mint(*this) /= mint(a);}
  mint operator/(const int& a)const{ return mint(*this) /= mint(a);}
  mint& operator=(const ll&a){ this->x = a; return (*this);}
  mint& operator=(const int&a){ this->x = a; return (*this);}
  mint ex(ll t) const {
    if(!t) return 1;
    mint res = ex(t/2);
    res *= res;
    return (t&1)?res*x:res;
  }
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
  bool operator!=(const mint& a)const{ return x != a.x;}
};

mint ex(mint x, ll t) { return x.ex(t);}
mint operator/(ll a, mint b)    {   return mint(a) / b; }
mint operator*(ll a, mint b)    {   return mint(a) * b; }
mint operator+(ll a, mint b)    {   return mint(a) + b; }
mint operator-(ll a, mint b)    {   return mint(a) - b; }
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x % MOD;return o;}

mint dp[3010][3010];

main(){    
    #ifdef XOX
        freopen("D:\\V S Code\\cpp\\competitiveProgramming\\Input.txt", "r", stdin);
        freopen("D:\\V S Code\\cpp\\competitiveProgramming\\OPT.txt", "w", stdout);
    #endif

    ios::sync_with_stdio(!cin.tie(NULL));
    
    int n;
    cin >> n;
    string s;
    cin >> s;

    dp[1][1] = 1;

    for(int i = 2; i <= n; i++){
        for(int j = 1; j <= i; j++){
            if(s[i - 2] == '<')
                dp[i][j] = dp[i - 1][j - 1] + dp[i][j - 1];
            else    dp[i][j] = dp[i][j - 1] + dp[i - 1][i - 1] - dp[i - 1][j - 1];
        }
    }

    cout << dp[n][n] ;
    
}

Measured memory_bytes: 71040