#include <bits/stdc++.h>
using namespace std;
int n;
string s;
bool tab[100100];
int arr[100100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> s;
  fill(tab, tab + n, false);
  for (int i = 0; i < n; ++i) cin >> arr[i];
  int current = 0;
  while (current >= 0 && current < n) {
    if (tab[current]) break;
    tab[current] = true;
    if (s[current] == '>')
      current += arr[current];
    else
      current -= arr[current];
  }
  if (current >= 0 && current < n)
    cout << "INFINITE" << endl;
  else
    cout << "FINITE" << endl;
  return 0;
}
