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