#include <bits/stdc++.h>
int visited[100005];
int main() {
  long long int n, i;
  scanf("%I64d", &n);
  char s[n + 5];
  long long int arr[n];
  scanf("%s", &s);
  for (i = 0; i < n; i++) scanf("%I64d", &arr[i]);
  i = 0;
  while (1) {
    visited[i] = 1;
    if (s[i] == '<')
      i -= arr[i];
    else
      i += arr[i];
    if ((i < 0) || (i >= n)) {
      printf("FINITE\n");
      return 0;
    } else if (visited[i]) {
      printf("INFINITE\n");
      return 0;
    }
  }
  return 0;
}
