#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int vis[N], b[N];
char a[N];
int main() {
  int n;
  cin >> n;
  scanf("%s", a + 1);
  for (int i = 1; i <= n; i++) cin >> b[i];
  int st = 1;
  int flag = 0;
  for (int i = 1; i <= 2 * n; i++) {
    if (a[st] == '<') {
      st -= b[st];
      if (st <= 0) {
        flag = 1;
        break;
      }
    } else {
      st += b[st];
      if (st > n) {
        flag = 1;
        break;
      }
    }
  }
  if (flag) {
    printf("FINITE\n");
  } else {
    printf("INFINITE\n");
  }
}
