#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 10;
int n;
int a[maxn];
bool was[maxn];
bool solve() {
  int cur = 0;
  while (cur >= 0 && cur < n) {
    if (was[cur]) {
      return false;
    }
    was[cur] = true;
    cur += a[cur];
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  string tmp;
  cin >> tmp;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    if (tmp[i] == '<') {
      a[i] *= -1;
    }
  }
  if (solve()) {
    cout << "FINITE" << endl;
  } else {
    cout << "INFINITE" << endl;
  }
  return 0;
}
