#include <bits/stdc++.h>
using namespace std;
void _IOS() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
}
const long long mod = 1e9 + 7;
long long n, m, k, w;
long long a[100009];
bool ch(char s) {
  return s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u';
}
bool palid(string s) {
  int n = s.length();
  for (int i = 0; i < n / 2; i++)
    if (s[i] != s[n - i - 1]) return 0;
  return 1;
}
int mp[200005];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) cin >> a[i];
  int i = 0;
  bool f = 1;
  while (i >= 0 && i < n) {
    if (mp[i]) {
      f = 0;
      break;
    }
    mp[i] = 1;
    if (s[i] == '>')
      i += a[i];
    else
      i -= a[i];
  }
  if (f)
    cout << "FINITE";
  else
    cout << "INFINITE";
}
