#include <bits/stdc++.h>
using namespace std;
inline long long int gcd(long long int a, long long int b) {
  a = abs(a);
  b = abs(b);
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
inline long long int power(long long int a, long long int p) {
  long long int res = 1, x = a;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
inline long long int bigmod(long long int a, long long int p, long long int m) {
  long long int res = 1 % m, x = a % m;
  while (p) {
    if (p & 1) res = (res * x) % m;
    x = (x * x) % m;
    p >>= 1;
  }
  return res;
}
bool visit[100009];
int main() {
  int n;
  cin >> n;
  char dir[n];
  int jump[n];
  for (int i = 0; i < n; i++) {
    cin >> dir[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> jump[i];
  }
  int pos = 0;
  while (!visit[pos]) {
    visit[pos] = 1;
    if (dir[pos] == '>') {
      pos += jump[pos];
    } else {
      pos -= jump[pos];
    }
    if (pos < 0 || pos >= n) {
      return cout << "FINITE\n", 0;
    }
  }
  cout << "INFINITE\n";
  return 0;
}
