#include <bits/stdc++.h>
using namespace std;
int main() {
  int *arr;
  char *direct;
  bool *check;
  int n;
  cin >> n;
  arr = new int[n];
  direct = new char[n];
  check = new bool[n];
  for (int i = 0; i < n; i++) {
    cin >> direct[i];
    check[i] = false;
  }
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int cur = 0;
  for (int i = 0; i < n; i++) {
    check[cur] = true;
    if (direct[cur] == '>') {
      cur += arr[cur];
      if (cur >= n || cur < 0) {
        cout << "FINITE";
        break;
      } else if (check[cur] == true) {
        cout << "INFINITE";
        break;
      }
    } else {
      cur -= arr[cur];
      if (cur >= n || cur < 0) {
        cout << "FINITE";
        break;
      } else if (check[cur] == true) {
        cout << "INFINITE";
        break;
      }
    }
  }
  return 0;
}
