#include <bits/stdc++.h>
using namespace std;
int num[100005];
bool vis[100005];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(vis, false, sizeof(vis));
    string s;
    cin >> s;
    int now = 0;
    for (int i = 0; i < n; i++) scanf("%d", &num[i]);
    while (1) {
      if (vis[now]) {
        puts("INFINITE");
        break;
      }
      vis[now] = 1;
      if (s[now] == '>')
        now += num[now];
      else
        now -= num[now];
      if (now >= n || now < 0) {
        puts("FINITE");
        break;
      }
    }
  }
  return 0;
}
