#include <bits/stdc++.h>
int main(void) {
  char a[100001];
  long long current, jump[100001], n, i;
  int flag = 1, visited[100001];
  memset(visited, 0, sizeof(visited));
  scanf("%lld", &n);
  if (n == 1) {
    printf("FINITE");
    return 0;
  }
  scanf("%s", a);
  for (i = 1; i <= n; i++) scanf("%lld", &jump[i]);
  current = 1;
  i = 1;
  while (flag == 1) {
    visited[current] = 1;
    if (a[current - 1] == '>') {
      current = current + jump[current];
    } else {
      current = current - jump[current];
    }
    if (current < 1 || current > n) {
      flag = 0;
      break;
    }
    if (visited[current] == 1) {
      break;
    }
  }
  if (flag == 0) {
    printf("FINITE");
  } else {
    printf("INFINITE");
  }
  return 0;
}
