#include <bits/stdc++.h>
using namespace std;
int n, used[100003], m[100003];
string s, ans = "INFINITE";
void DFS(int v) {
  if (used[v] == 1) {
    ans = "INFINITE";
    return;
  }
  used[v] = 1;
  if (s[v] == '<') {
    if (v - m[v] > 0)
      DFS(v - m[v]);
    else {
      ans = "FINITE";
      return;
    }
  } else {
    if (v + m[v] <= n)
      DFS(v + m[v]);
    else {
      ans = "FINITE";
      return;
    }
  }
}
int main() {
  cin >> n >> s;
  s = ' ' + s;
  for (int k = 1; k <= n; k++) cin >> m[k];
  DFS(1);
  cout << ans;
  return 0;
}
