#include <bits/stdc++.h>
using namespace std;
int a[100000];
bool used[100000];
string dir;
int main() {
  int n;
  cin >> n;
  cin >> dir;
  for (int i = 0; i < n; i++) cin >> a[i];
  int u = 0;
  bool ans;
  while (true) {
    if (u >= n || u < 0) {
      ans = true;
      break;
    } else if (used[u]) {
      ans = false;
      break;
    } else {
      used[u] = true;
      if (dir[u] == '>')
        u += a[u];
      else
        u -= a[u];
    }
  }
  if (ans)
    cout << "FINITE" << endl;
  else
    cout << "INFINITE" << endl;
  return 0;
}
