#include <bits/stdc++.h>
using namespace std;
int n, d;
vector<int> *g;
bool BFS(int s) {
  queue<int> q;
  q.push(s);
  vector<char> used(n);
  used[s] = true;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < g[v].size(); i++) {
      int to = g[v][i];
      if (to >= n || to < 0) return true;
      if (!used[to]) {
        used[to] = true;
        q.push(to);
      }
    }
  }
  return false;
}
int main() {
  cin >> n;
  string s;
  g = new vector<int>[n];
  cin >> s;
  long long k = 1;
  for (int i = 0; i < n; i++) {
    cin >> d;
    if (s[i] == '>')
      g[i].push_back(i + d);
    else
      g[i].push_back(i - d);
  }
  if (BFS(0))
    cout << "FINITE";
  else
    cout << "INFINITE";
  return 0;
}
