#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0);
string s;
int n;
int A[100010], vis[100010];
int dfs(int node, int l) {
  vis[node] = l;
  int nx;
  if (s[node] == '>') {
    nx = node + A[node];
  } else
    nx = node - A[node];
  if (nx < 0 || nx >= n) return 1;
  if (vis[nx] == l)
    return 0;
  else if (vis[nx] == 0)
    return dfs(nx, l);
}
void solve() {
  cin >> n;
  cin >> s;
  memset(vis, 0, sizeof(vis));
  ;
  for (int i = 0; i <= n - 1; ++i) {
    cin >> A[i];
  }
  int flag = 1;
  flag = dfs(0, 1);
  if (!flag) {
    cout << "INFINITE\n";
  } else
    cout << "FINITE\n";
}
int main() {
  clock_t tm = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int _t = 1; _t <= t; ++_t) {
    solve();
  }
  tm = clock() - tm;
  cerr << (float)(tm) / CLOCKS_PER_SEC << "\n";
  return 0;
}
