#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> v(n);
  for (long long &first : v) cin >> first;
  long long curr = 2 * n, pos = 0;
  while (curr) {
    if (pos < 0 || pos >= n) {
      cout << "FINITE";
      return 0;
    }
    if (s[pos] == '>')
      pos = pos + v[pos];
    else
      pos = pos - v[pos];
    curr--;
  }
  cout << "INFINITE";
}
