#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795028841971693993751;
const long long int maxn = 2 * 1e5 + 1, inf = 1e9 + 1;
bool b[maxn];
long long int n;
string s;
long long int a[maxn];
bool x = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int now = 0;
  while (now >= 0 && now < n) {
    if (s[now] == '<')
      now -= a[now];
    else
      now += a[now];
    if (now < 0 || now >= n) break;
    if (b[now]) {
      x = 1;
      break;
    }
    b[now] = 1;
  }
  if (x)
    cout << "INFINITE";
  else
    cout << "FINITE";
  cout << endl;
  return 0;
}
