#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int _x;
  scanf("%d", &_x);
  return _x;
}
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e5 + 5;
const int logn = 20;
int N, d[maxn], used[maxn];
char q[maxn];
int main() {
  cin >> N;
  scanf("%s", q + 1);
  for (int i = 1; i <= N; i++) scanf("%d", d + i);
  int cur = 1;
  while (cur <= N && cur >= 1) {
    if (used[cur]) {
      printf("INFINITE\n");
      return 0;
    }
    used[cur] = 1;
    if (q[cur] == '>')
      cur += d[cur];
    else
      cur -= d[cur];
  }
  printf("FINITE\n");
  return 0;
}
