#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9, mxn = 100010;
int A[mxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = (0); i < (n); ++i) cin >> A[i];
  vector<bool> visited(n);
  int curr = 0;
  visited[0] = true;
  while (true) {
    curr += (s[curr] == '>' ? A[curr] : -A[curr]);
    if ((curr < 0 || curr >= n) || visited[curr]) break;
    visited[curr] = true;
  }
  cout << ((curr < 0 || curr >= n) ? "FINITE" : "INFINITE") << '\n';
  return 0;
}
