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
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        T_Permutation solver = new T_Permutation();
        solver.solve(1, in, out);
        out.close();
    }

    static class T_Permutation {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.ni();
            String s = in.ns();
            long mod = (int) 1e9 + 7;
            long[][] dp = new long[n][n + 1];
            dp[0][1] = 1;
            for (int i = 1; i < n; i++) {
                if (s.charAt(i - 1) == '<') {
                    long sum = 0;
                    for (int j = 1; j <= i; j++) {
                        sum += dp[i - 1][j];
                        dp[i][j + 1] = (dp[i][j + 1] + sum) % mod;
                    }
                } else {// >
                    long sum = 0;
                    for (int j = i; j >= 1; j--) {
                        sum += dp[i - 1][j];
                        dp[i][j] = (dp[i][j] + sum) % mod;
                    }
                }
            }
            long ans = 0;
            for (int i = 1; i < n + 1; i++) {
                ans += dp[n - 1][i];
            }
            out.println(ans % mod);
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(ns());
        }

    }
}

