#include <bits/stdc++.h>
using namespace std;
inline int nxt() {
  int first;
  scanf("%d", &first);
  return first;
}
int main() {
  int n = nxt();
  string s;
  cin >> s;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = nxt();
  }
  vector<char> used(n);
  int i = 0;
  while (i >= 0 && i < n && !used[i]) {
    used[i] = 1;
    if (s[i] == '>')
      i += a[i];
    else
      i -= a[i];
  }
  cout << ((i >= 0 && i < n) ? "INFINITE" : "FINITE") << "\n";
  return 0;
}
