#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  pair<char, int> mas[100001];
  cin >> n;
  for (int i = 1; i <= 100000; i++) mas[i].second = 0;
  for (int i = 1; i <= n; i++) cin >> mas[i].first;
  for (int i = 1; i <= n; i++) cin >> mas[i].second;
  int k = 1;
  int jump = 0;
  while (jump != 100001) {
    if (mas[k].first == '>') k += mas[k].second;
    if (k > n) {
      cout << "FINITE";
      return 0;
    }
    if (mas[k].first == '<') k -= mas[k].second;
    if (k <= 0) {
      cout << "FINITE";
      return 0;
    }
    ++jump;
  }
  cout << "INFINITE";
  return 0;
}
