#include <bits/stdc++.h>
using namespace std;
int a[100000], vis[100000];
char s[100001];
int main() {
  int n, i, pos = 0;
  scanf("%d", &n);
  scanf("%s", s);
  for (i = 0; n > i; i++) {
    scanf("%d", &a[i]);
    vis[i] = 0;
  }
  while (pos >= 0 && pos < n) {
    if (vis[pos] == 0) {
      vis[pos] = 1;
    } else {
      break;
    }
    if (s[pos] == '>') {
      pos = pos + a[pos];
    } else {
      pos = pos - a[pos];
    }
  }
  if (pos >= 0 && pos < n) {
    printf("INFINITE");
  } else {
    printf("FINITE");
  }
  return 0;
}
