#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 123;
const long long INF = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
int n;
char c[10 * N];
int d[10 * N];
bool u[10 * N];
int s;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
  }
  s = 1;
  while (1) {
    if (s < 1 || s > n) {
      cout << "FINITE";
      return 0;
    }
    u[s] = 1;
    if (c[s] == '>') {
      s += d[s];
      if (s < 1 || s > n) {
        cout << "FINITE";
        return 0;
      }
      if (u[s]) {
        cout << "INFINITE";
        return 0;
      }
    } else {
      s -= d[s];
      if (s < 1 || s > n) {
        cout << "FINITE";
        return 0;
      }
      if (u[s]) {
        cout << "INFINITE";
        return 0;
      }
    }
  }
  return 0;
}
