Let N be a positive integer. You are given a string s of length N - 1, consisting of `<` and `>`.

Find the number of permutations (p_1, p_2, \ldots, p_N) of (1, 2, \ldots, N) that satisfy the following condition, modulo 10^9 + 7:

* For each i (1 \leq i \leq N - 1), p_i < p_{i + 1} if the i-th character in s is `<`, and p_i > p_{i + 1} if the i-th character in s is `>`.

Constraints

* N is an integer.
* 2 \leq N \leq 3000
* s is a string of length N - 1.
* s consists of `<` and `>`.

Input

Input is given from Standard Input in the following format:


N
s


Output

Print the number of permutations that satisfy the condition, modulo 10^9 + 7.

Examples

Input

4
<><


Output

5


Input

5
<<<<


Output

1


Input

20
>>>><>>><>><>>><<>>


Output

217136290
/*
[ ( ^ _ ^ ) ]
*/

// problem: atc/dp_t

// package atc.t;

import java.io.*;
import java.util.*;


public class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;

    void solve(InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        char[] s = (" "+in.next().trim()).toCharArray();
        char lt = '<';

        long[][] dp = new long[n][n];
        dp[0][0] = 1;
        
        for(int i=1; i<n; i++) {
            for(int j=0; j<=i; j++) {
                if(s[i]==lt) {
                    dp[i][j] = dp[i-1][i-1] - (j>0?dp[i-1][j-1]:0);
                    dp[i][j] = (dp[i][j]%MOD + MOD)%MOD;
                } else {
                    if(j>0) dp[i][j] = dp[i-1][j-1];
                }
                if(j>0) dp[i][j] = (dp[i][j] + dp[i][j-1])%MOD;
            }
            // show("", dp[i]);
        }
        out.println(dp[n-1][n-1]);
    }
    

    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}