#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
char jump[MAXN];
int size[MAXN], mrc[MAXN];
int main() {
  int n = 0;
  scanf("%d", &n);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &jump[i]);
  }
  for (int i = 0; i < n; i++) scanf("%d", &size[i]);
  for (int i = 0; i < n; i++) mrc[i] = 0;
  int k = 0;
  while (!mrc[k]) {
    mrc[k] = 1;
    if (jump[k] == '>') {
      k = k + size[k];
    } else {
      k = k - size[k];
    }
    if (k < 0 || k >= n) {
      break;
    }
  }
  if (k >= 0 && k < n) {
    printf("IN");
  }
  printf("FINITE\n");
  return 0;
}
