#include <bits/stdc++.h>
using namespace std;
const double eps = 1.0e-8;
const double PI = acos(-1.0);
template <typename T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
T f_max(T a, T b) {
  return a > b ? a : b;
}
const int maxn = 100010;
char c[maxn];
int n, a[maxn];
bool vis[maxn];
void solve() {
  memset(vis, 0, sizeof(vis));
  int i = 1;
  while (1) {
    if (vis[i]) {
      puts("INFINITE");
      return;
    }
    vis[i] = 1;
    if (c[i - 1] == '>') {
      if (i + a[i] > n) {
        puts("FINITE");
        return;
      } else
        i = i + a[i];
    } else {
      if (i - a[i] <= 0) {
        puts("FINITE");
        return;
      } else
        i = i - a[i];
    }
  }
}
int main() {
  scanf("%d", &n);
  scanf("%s", c);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  solve();
  return 0;
}
