Little Artem found a grasshopper. He brought it to his house and constructed a jumping area for him.

The area looks like a strip of cells 1 × *n*. Each cell contains the direction for the next jump and the length of that jump. Grasshopper starts in the first cell and follows the instructions written on the cells. Grasshopper stops immediately if it jumps out of the strip. Now Artem wants to find out if this will ever happen.
The first line of the input contains a single integer *n* (1 ≤ *n* ≤ 100 000) — length of the strip. 

Next line contains a string of length *n* which consists of characters "&lt;" and "&gt;" only, that provide the direction of the jump from the corresponding cell. Next line contains *n* integers *d*<sub class="lower-index">*i*</sub> (1 ≤ *d*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the length of the jump from the *i*-th cell.
In the first sample grasshopper starts from the first cell and jumps to the right on the next cell. When he is in the second cell he needs to jump two cells left so he will jump out of the strip.

Second sample grasshopper path is 1 - 3 - 2 - 3 - 2 - 3 and so on. The path is infinite.
2
><
1 2
FINITE
3
>><
2 1 1
INFINITE
1
>
1000000000
FINITE
1
<
1000000000
FINITE
2
>>
1 1
FINITE
5
>><><
1 2 3 1 2
FINITE
5
>><><
1 2 2 1 2
INFINITE
10
>>>>>>>>><
1 1 1 1 1 1 1 1 1 10
FINITE
10
>>>>>>>>><
1 1 1 1 1 1 1 1 1 5
INFINITE
10
>>>>>>>>><
1 1 1 1 1 1 1 1 1 1
INFINITE
3
><<
2 1 1
INFINITE
10
>>>>>>>>>>
1 1 1 1 1 1 1 1 1 100
FINITE
3
><<
2 100 2
INFINITE
3
><<
2 3 2
INFINITE
3
>><
2 3 2
INFINITE
3
><>
1 1 1
INFINITE
3
>><
2 2 2
INFINITE
4
>><<
2 100 2 100
INFINITE
3
><>
1 1 3
INFINITE
5
><>>>
1 1 10 10 10
INFINITE
5
><<<<
500 1 2 3 4
FINITE
4
><><
2 1000 1 1
INFINITE
3
><<
2 10 2
INFINITE
3
><<
2 5 2
INFINITE
2
><
5 5
FINITE
3
>><
1 10 10
FINITE
4
><<>
2 1 1 5
INFINITE
5
<<>>>
1 1 1 1 1
FINITE
3
><>
1 1 12345
INFINITE
4
>>><
3 2 2 3
INFINITE
3
><>
1 1 100000
INFINITE
def check (arr3,x):
  for i in range(len(arr3)):
    if x == arr3[i]:
      return True
      break
  return False
n = int(input())
s = input()
arr = []
for i in range(n):
  arr.append(s[i])
s2 = input()
arr2 = s2.split(' ')
for i in range(n):
  arr2[i] = int(arr2[i])
i = 0
arr3 = []
while 1:
  while i < n:
    
    if check(arr3,i) == True:
      print('INFINITE')
      exit()
    elif i < 0 or i > n:
      print('FINITE')
      exit()
    if arr[i] == '>':
      i = i + arr2[i]
    elif arr[i] == '<':
      i = i - arr2[i]
    arr3.append(i)
    