#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MAXM = 1000005;
const int MOD = 1000000007;
const int MAMOD = 998244353;
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double EPS = 1e-8;
int n;
string s;
int d[MAXN];
bool vis[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> s;
  for (int i = 0; i < n; ++i) cin >> d[i];
  int st = 0, ok = 1;
  while (st >= 0 && st < n) {
    if (vis[st]) {
      ok = 0;
      break;
    }
    vis[st] = 1;
    if (s[st] == '<')
      st -= d[st];
    else
      st += d[st];
  }
  if (ok)
    cout << "FINITE"
         << "\n";
  else
    cout << "INFINITE"
         << "\n";
  return 0;
}
