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