#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  ;
  {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<int> pos;
    int cur_pos = 0;
    int f = 0, q = 0;
    while (1) {
      if (find(pos.begin(), pos.end(), cur_pos) != pos.end()) {
        f = 1;
        break;
      }
      pos.push_back(cur_pos);
      if (cur_pos < 0 || cur_pos >= n) {
        q = 1;
        break;
      }
      if (s[cur_pos] == '>')
        cur_pos += a[cur_pos];
      else
        cur_pos -= a[cur_pos];
    }
    if (f == 1)
      cout << "INFINITE" << endl;
    else if (q == 1)
      cout << "FINITE" << endl;
  }
}
