import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

/*

（1からNではなく、0からN-1として考える）

0からiまでを並べ、s[0 .. i] に従い、最後が j で終わる場合の数をxs[i][j]とする

xs[0][0] = 1
xs[0][j] = 0

s[i] = '<' の場合
xs[i][j] = sum(j'; 0 .. j) xs[i - 1][j']

s[i] = '>' の場合
xs[i][j] = sum(j'; j .. i) xs[i - 1][j']

このsumは愚直にループを回すとTLEになるが、累積和ならOK

求めるものは sum(j; 0 .. j) xs[n][j]

----------------------------------------

*/

const mod = 1_000_000_007;

void main(){
	long n = read.to!long;
	string s = readln.chomp;
	
	long[][] xs = new long[][](n, n);
	xs[0][0] = 1;
	debug writeln("i:", 0, " xs:", xs);
	
	foreach(i; 1 .. n){
		if(s[i - 1] == '<'){
			long sum = 0;
			foreach(j; 0 .. i + 1){
				if(j > 0) sum += xs[i - 1][j - 1], sum %= mod;
				debug writeln("i:", i, " j:", j, " sum:", sum);
				xs[i][j] = sum;
			}
		}
		else{
			long sum = 0;
			foreach_reverse(j; 0 .. i + 1){
				if(j < i) sum += xs[i - 1][j], sum %= mod;
				debug writeln("i:", i, " j:", j, " sum:", sum);
				xs[i][j] = sum;
			}
		}
		debug writeln("i:", i, " xs:", xs);
	}
	
	long ans = 0;
	foreach(j; 0 .. n) ans += xs[n - 1][j], ans %= mod;
	
	ans.writeln;
}
