#include <bits/stdc++.h>
char s[100100];
bool f[100100];
int a[100100];
int main() {
  int n;
  scanf("%d\n", &n);
  gets(s);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  bool ans = true;
  memset(f, false, sizeof(f));
  for (int i = 0; i >= 0 && i < n; i += a[i] * (s[i] == '>' ? 1 : -1)) {
    if (f[i]) {
      ans = false;
      break;
    }
    f[i] = true;
  }
  if (ans)
    printf("FINITE\n");
  else
    printf("INFINITE\n");
  return 0;
}
