#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
bool mark[N];
int n;
string s;
int a[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int x = 0;
  while ((0 <= x && x < n) && !mark[x]) {
    mark[x] = true;
    if (s[x] == '>')
      x += a[x];
    else
      x -= a[x];
  }
  if (!(0 <= x && x < n))
    cout << "FINITE\n";
  else
    cout << "INFINITE\n";
  return 0;
}
