#include <bits/stdc++.h>
using namespace std;
const int L = (int)1e5;
bool visited[L];
char C[L];
int jump[L];
int main() {
  int temp;
  int N;
  scanf("%d", &N);
  scanf("%s", C);
  for (int i = 0; i < N; ++i) scanf("%d", jump + i);
  int point = 0;
  bool loop = 0;
  while (point >= 0 && point < N) {
    if (visited[point]) {
      loop = 1;
      break;
    }
    visited[point] = 1;
    if (C[point] == '>')
      point += jump[point];
    else
      point -= jump[point];
  }
  if (loop)
    printf("INFINITE\n");
  else
    printf("FINITE\n");
  return 0;
}
