output_description: Print the number of permutations that satisfy the condition, modulo 10^9 + 7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      s
attempt: temp = 1
  MOD = 10**9 + 7
  fact = [1]
  infact = [1]
  for i in range(1, 5000):
      temp *= i
      temp %= MOD
      fact += [temp]
      infact += [pow(temp, MOD - 2, MOD)]
  
  
  def binomial(a, b):
      up = fact[a]
      down = (infact[a - b] * infact[b]) % MOD
      return (up * down) % MOD
  
  
  def find(s):
      N = len(s) + 1
      dp = [[0 for i in range(N)] for j in range(N)]
      for length in range(1, N + 1):
          if length == 1:
              for start in range(0, N):
                  dp[start][start] = 1
              continue
          if length == 2:
              for start in range(0, N - 1):
                  dp[start][start + 1] = 1
              continue
          for start in range(0, N - length + 1):
              left = start
              right = start + length - 1
              if right > N - 1:
                  break
              if s[left] == ">":
                  dp[left][right] += dp[left + 1][right]
              if s[right - 1] == "<":
                  dp[left][right] += dp[left][right - 1]
              for j in range(left, right):
                  if s[j] == "<" and s[j + 1] == ">":
                      need = j + 1
                      dp[left][right] += (
                          binomial(length - 1, need - left)
                          * dp[left][need - 1]
                          * dp[need + 1][right]
                      ) % MOD
      # print(dp)
      return dp[0][N - 1] % MOD
  
problem_description: Statement
  
  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 `>`.
samples: [{"input": "4\n    <><", "output": "5\n    \n\nThere are five permutations that satisfy the condition, as follows:\n\n  * (1, 3, 2, 4)\n  * (1, 4, 2, 3)\n  * (2, 3, 1, 4)\n  * (2, 4, 1, 3)\n  * (3, 4, 1, 2)\n\n* * *"}, {"input": "5\n    <<<<", "output": "1\n    \n\nThere is one permutation that satisfies the condition, as follows:\n\n  * (1, 2, 3, 4, 5)\n\n* * *"}, {"input": "20\n    >>>><>>><>><>>><<>>", "output": "217136290\n    \n\nBe sure to print the number modulo 10^9 + 7."}]