#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
/* #include <regex> */

using namespace std;

/* g++ -g -std=c++11 */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

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

int getsum(const int i, const int j)
{ return (i < 0 || j < 0) ? 0 : sum[i][j]; }

int dfs(const int i, const int j)
{
    if (i == 0) {
        const int ans = s[i] == '>' ? j == 0 : j == 1;
        sum[i][j] = ans + getsum(i,j-1);
        sum[i][j] %= mod;
        return ans;
    }
    int& ans = dp[i][j];
    if (-1 == ans) {
        ans = 0;
        if (s[i] == '>') {
            if (j <= i) {
                ans += getsum(i-1,i)-getsum(i-1,j-1);
                ans %= mod;
            }
            /* FOR(x,j,i+1) { */
            /*     ans += dfs(i-1,x); */
            /*     ans %= mod; */
            /* } */
        }
        else {
            ans += getsum(i-1,j-1);
            ans %= mod;
            /* FOR(x,0,j) { */
            /*     ans += dfs(i-1,x); */
            /*     ans %= mod; */
            /* } */
        }
        sum[i][j] = ans + getsum(i,j-1);
        sum[i][j] %= mod;
    }
    ans += mod; ans %= mod;
    return ans;
}

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    int n;
    while (cin >> n) {
        memset(dp,-1,sizeof(dp));
        memset(sum,0,sizeof(sum));
        cin >> s;
        const int n = s.size();
        FOR(i,0,n) FOR(x,0,i+2)
            dfs(i,x);
        int ans = 0;
        FOR(x,0,n+1) {
            const int res = dfs(n-1,x);
            ans += dfs(n-1,x);
            ans %= mod;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 71040