import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int n;
    scan(n);
    auto s = readln.chomp;

    // dp(i, j) = (i番目までを{0, 1, .., i}で作り、末尾がjであって条件を満たす順列の数)
    auto dp = new long[][](n + 1, n + 1);
    dp[0][0] = 1;

    foreach (i ; 1 .. n) {
        if (s[i - 1] == '<') {
            // dp(i, j) = dp(i - 1, 0) + dp(i - 1, 1) + .. + dp(i - 1, j - 1)
            //          = dp(i, j - 1) + dp(i - 1, j - 1)
            foreach (j ; 1 .. i + 1) {
                dp[i][j] = dp[i-1][j-1] + dp[i][j-1];
                dp[i][j] %= mod;
            }
        }
        else {
            // dp(i, j) = dp(i - 1, j) + dp(i - 1  j + 1) + .. + dp(i - 1, i - 1)
            //          = dp(i - 1, j) + dp(i, j + 1)
            foreach_reverse (j ; 0 .. i) {
                dp[i][j] = dp[i-1][j] + dp[i][j + 1];
                dp[i][j] %= mod;
            }
        }
    }

    long ans;
    foreach (i ; 0 .. n) {
        ans += dp[n - 1][i];
        ans %= mod;
    }
    writeln(ans);
}





void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
