#ifndef __cplusplus
    cat << EOF
#endif
#include <bits/stdc++.h>
using namespace std;

#define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0)(__VA_ARGS__)
#define rep_0(i, end) for(int i = 0; i < (end); ++i)
#define rep_1(i, fr, ba) for(int i = (fr); i <= (ba); ++i)
#define overload_rep(arg0, arg1, arg2, name, ...) name
#define all(box) box.begin(), box.end()

template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if(lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if(lhs > rhs) { lhs = rhs; return 1; } return 0; }

template <int MODULUS = 1000000007>
struct modulo_int {
private:

    long long value;
    constexpr void normalize() {
        value %= MODULUS;
        if(value < 0) value += MODULUS;
    }

public:

    constexpr modulo_int(const long long& value_ = 0) : value(value_) { normalize(); }
    constexpr modulo_int operator - () const { return modulo_int(MODULUS - value); }
    constexpr modulo_int operator ~ () const { return power(MODULUS - 2); }
    constexpr long long operator () () { return value; }

    constexpr modulo_int operator + (const modulo_int& rhs) const { return modulo_int(*this) += rhs; }
    constexpr modulo_int& operator += (const modulo_int& rhs) {
        if ((value += rhs.value) >= MODULUS) value -= MODULUS;
        return (*this);
    }

    constexpr modulo_int operator - (const modulo_int& rhs) const { return modulo_int(*this) -= rhs; }
    constexpr modulo_int& operator -= (const modulo_int& rhs) {
        if ((value += MODULUS - rhs.value) >= MODULUS) value -= MODULUS;
        return (*this);
    }

    constexpr modulo_int operator * (const modulo_int& rhs) const { return modulo_int(*this) *= rhs; }
    constexpr modulo_int& operator *= (const modulo_int& rhs) {
        (value *= rhs.value) %= MODULUS;
        return (*this);
    }

    constexpr modulo_int operator / (const modulo_int& rhs) const { return modulo_int(*this) /= rhs; }
    constexpr modulo_int& operator /= (const modulo_int& rhs) {
        return (*this) *= ~rhs;
    }

    constexpr modulo_int power(const long long& power_) const {
        modulo_int result(1), mult(*this);
        for (long long t = power_; t > 0; t >>= 1) {
            if(t & 1) result *= mult;
            mult *= mult;
        }
        return result;
    }

    friend std::istream& operator >> (std::istream& stream, modulo_int& lhs) {
        stream >> lhs.value;
        lhs.normalize();
        return stream;
    }

    friend std::ostream& operator << (std::ostream& stream, const modulo_int& rhs) {
        return stream << rhs.value;
    }

};

constexpr int MAX_N = 3000;
using modint = modulo_int<>;

int N;
string S;
modint dp[MAX_N][MAX_N];

int main() {

    cin >> N >> S;
    rep(i, N) dp[0][i] = 1;

    rep(i, N - 1) {
        if(S[i] == '<') {
            modint sum;
            for(int j = N; j > 0; --j) {
                sum += dp[i][j];
                dp[i + 1][j - 1] += sum;
            }
        } else {
            modint sum;
            rep(j, N - i - 1) {
                sum += dp[i][j];
                dp[i + 1][j] += sum;
            }
        }
    }

    cout << dp[N - 1][0] << '\n';
    return 0;

}


Measured memory_bytes: 70528