#include <bits/stdc++.h>
using namespace std;
const int INF = numeric_limits<int>::max();
const long long LLINF = numeric_limits<long long>::max();
const unsigned long long ULLINF = numeric_limits<unsigned long long>::max();
const double PI = acos(-1.0);
bool used[100010];
string s;
long long d[100010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  cin >> s;
  int cur = 0;
  for (int i = 0; i < n; i++) cin >> d[i];
  int turn = 0;
  while (turn <= 10000000) {
    if (used[cur]) {
      cout << "INFINITE";
      return 0;
    }
    used[cur] = 1;
    if (s[cur] == '>') {
      if (cur + d[cur] >= n) {
        cout << "FINITE";
        return 0;
      } else {
        cur = cur + d[cur];
      }
    } else {
      if (cur - d[cur] < 0) {
        cout << "FINITE";
        return 0;
      } else {
        cur = cur - d[cur];
      }
    }
    turn++;
  }
  cout << "INFINITE";
  return 0;
}
