#include <bits/stdc++.h>
using namespace std;
int main() {
  int u;
  u = 1;
  while (u--) {
    long long int i = 0, j = 0, k = 0, m, n, s1 = 0, r = 0, l = 0, l1 = 0,
                  c = 0, d = 0, na, nb;
    cin >> n;
    long long int a[n];
    string s;
    cin >> s;
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (i = 0; i <= n; i++) {
      if (c >= n || c < 0) {
        cout << "FINITE";
        return 0;
      }
      if (s[c] == '>') {
        c += a[c];
      } else
        c -= a[c];
    }
    cout << "INFINITE";
  }
  return 0;
}
