package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
	"strconv"
	"math"
)

var INF int32 = math.MaxInt32
var INF64 int64 = math.MaxInt64

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func readLineNums(bf *bufio.Reader) []int {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []int{}
	for _, field := range fields {
		num, _ := strconv.Atoi(field)
		nums = append(nums, num)
	}
	return nums
}

func readLineNum64s(bf *bufio.Reader) []int64 {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []int64{}
	for _, field := range fields {
		num, _ := strconv.ParseInt(field, 10, 64)
		nums = append(nums, num)
	}
	return nums
}

func readLineFloats(bf *bufio.Reader) []float64 {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []float64{}
	for _, field := range fields {
		num, _ := strconv.ParseFloat(field, 64)
		nums = append(nums, num)
	}
	return nums
}

func readLineStrs(bf *bufio.Reader) []string {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	return strings.Split(line, " ")
}

func main() {
	bf := bufio.NewReader(os.Stdin)
	N := readLineNums(bf)[0]
	s := readLineStrs(bf)[0]

	/*
		定义:
			dp[i][j]: 表示满足s[0:i]: 以数字j结尾的个数
		初始值:
			dp[1][1]=1 // 如果s[0]='<'
			dp[1][2]=1 // 如果s[0]='>'
		转移方程:
			dp[i][j] // 新增数字i+1
				s[i]='<':
					sum(dp[i-1][jj]) // 1<=jj<=i   // 都满足条件
									 // 1<=jj<=i-1 // 用i+1和i替换
									 // 1<=jj<=i-2 // 用i和i-1替换
									 // 直到jj=2
				s[i]='>':
					sum(dp[i-1][jj]) // i<jj<=i+1   // 用i+1和i替换
								     // i-1<jj<=i+1 // 用i和i-1替换
									 // i-2<jj<=i+1 // 用i-1和i-2替换
									 // 直到i=1
	*/
	dp := make([][]int, N)
	for i := range dp {
		dp[i] = make([]int, N+1)
	}

	// i=1
	if s[0] == '<' {
		dp[1][2] = 1
	}
	if s[0] == '>' {
		dp[1][1] = 1
	}

	// i>=2
	M := 1000000007
	for i:=2; i<=N-1; i++ {
		ch := s[i-1]
		j := i+1 // 新增的数字

		// 优化掉内部的两个循环
		pSums := make([]int, N+1)
		for j:=1; j<=N; j++ {
			pSums[j] = pSums[j-1]+dp[i-1][j]
			if pSums[j] >= M {
				pSums[j] -= M
			}
		}

		if ch == '<' {
			for jj:=j; jj>=2; jj--{
				dp[i][jj] += pSums[jj-1]
				if dp[i][jj] >= M {
					dp[i][jj] -= M
				}
			}

			//for ii:=j; ii>=2; ii-- {
			//	for jj:=1; jj<ii; jj++ {
			//		dp[i][ii] += dp[i-1][jj]
			//		if dp[i][ii] >= M {
			//			dp[i][ii] -= M
			//		}
			//	}
			//}
		}

		if ch == '>' {
			for jj:=j-1; jj>=1; jj-- {
				dp[i][jj] += pSums[j]-pSums[jj-1]
				if dp[i][jj] >= M {
					dp[i][jj] -= M
				}
				if dp[i][jj] < 0 {
					dp[i][jj] += M
				}
			}

			//for ii:=j-1; ii>=1; ii-- {
			//	for jj:=ii; jj<=j; jj++ {
			//		dp[i][ii] += dp[i-1][jj]
			//		if dp[i][ii] >= M {
			//			dp[i][ii] -= M
			//		}
			//	}
			//}
		}
	}

	ans := 0
	for i:=1; i<=N; i++ {
		ans += dp[N-1][i]
		if ans >= M {
			ans -= M
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 95872