md = 10 ** 9 + 7

n = int(eval(input()))

s = eval(input())

dp = [1] * n

for i in range(n - 1):

    if s[i] == "<":

        for dpi in range(1, n - i - 1):

            dp[dpi] = (dp[dpi] + dp[dpi - 1]) % md

        dp = dp[:-1]

    else:

        for dpi in range(n - i - 2, 0, -1):

            dp[dpi] = (dp[dpi] + dp[dpi + 1]) % md

        dp = dp[1:]

print((dp[0]))

md = 10 ** 9 + 7

n = int(eval(input()))

s = eval(input())

dp = [1] * n

for i in range(n - 1):

    if s[i] == "<":

        L = dp[0]

        for dpi in range(1, n - i - 1):

            dp[dpi] = L = (dp[dpi] + L) % md

        dp = dp[:-1]

    else:

        R = dp[-1]

        for dpi in range(n - i - 2, 0, -1):

            dp[dpi] = R = (dp[dpi] + R) % md

        dp = dp[1:]

print((dp[0]))

md = 10**9 + 7
n = int(eval(input()))
s = eval(input())
dp = [1] * n
for i in range(n - 1):
    if s[i] == "<":
        for dpi in range(1, n - i - 1):
            dp[dpi] = (dp[dpi] + dp[dpi - 1]) % md
        dp = dp[:-1]
    else:
        for dpi in range(n - i - 2, 0, -1):
            dp[dpi] = (dp[dpi] + dp[dpi + 1]) % md
        dp = dp[1:]
print((dp[0]))

md = 10**9 + 7
n = int(eval(input()))
s = eval(input())
dp = [1] * n
for i in range(n - 1):
    if s[i] == "<":
        L = dp[0]
        for dpi in range(1, n - i - 1):
            dp[dpi] = L = (dp[dpi] + L) % md
        dp = dp[:-1]
    else:
        R = dp[-1]
        for dpi in range(n - i - 2, 0, -1):
            dp[dpi] = R = (dp[dpi] + R) % md
        dp = dp[1:]
print((dp[0]))

+        L = dp[0] -            dp[dpi] = (dp[dpi] + dp[dpi - 1]) % md +            dp[dpi] = L = (dp[dpi] + L) % md +        R = dp[-1] -            dp[dpi] = (dp[dpi] + dp[dpi + 1]) % md +            dp[dpi] = R = (dp[dpi] + R) % md