#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  scanf("%lld", &n);
  ;
  char s[n + 10];
  long long arr[n + 1];
  bool pos[100009] = {0};
  scanf("%s", s);
  ;
  for (i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    ;
  }
  int flag = 0;
  i = 0;
  while (pos[i] == 0) {
    pos[i] = 1;
    if (s[i] == '<')
      i = i - arr[i];
    else
      i = i + arr[i];
    if (i < 0 || i >= n) {
      flag = 1;
      break;
    }
  }
  if (flag)
    printf("FINITE\n");
  else
    printf("INFINITE\n");
  return 0;
}
