#include <bits/stdc++.h>
using namespace std;
template <typename T>
T ExEuclide(T a, T b, T &x, T &y) {
  if (a < 0) {
    T d = euclide(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclide(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclide(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <typename T>
T BigMod(T p, T e, T m) {
  long long int ret = 1LL;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
template <typename T>
T POW(T N, T printf) {
  return (printf == 0) ? 1 : N * POW(N, printf - 1);
}
template <typename T>
T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <typename T>
T LCM(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <typename T>
T ModInv(T b, T m) {
  return BigMod(b, m - 2, m);
}
template <typename T>
T DIS(T x1, T y1, T x2, T y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
template <typename T>
T Angle(T x1, T y1, T x2, T y2) {
  return atan(double(y1 - y2) / double(x1 - x2));
}
template <typename T>
long long int IsLeft(T a, T b, T c) {
  return (a.x - b.x) * (b.y - c.y) - (b.x - c.x) * (a.y - b.y);
}
template <typename T>
T NextInt() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <class T, class X>
inline bool CheckBit(T a, X pos) {
  T t = 1;
  return (a & (t << pos));
}
template <class T, class X>
inline T OnBit(T a, X pos) {
  T t = 1;
  return (a | (t << pos));
}
template <class T, class X>
inline T OffBit(T a, X pos) {
  T t = 1;
  return (a & (~(t << pos)));
}
template <class T, class X>
inline T ToggleBit(T a, X pos) {
  T t = 1;
  return (a ^ (t << pos));
}
double DEG(double x) { return (180.0 * x) / (2.0 * acos(0.0)); }
double RAD(double x) { return (x * (double)2.0 * acos(0.0)) / (180.0); }
string NTS(long long int Number) {
  stringstream ss;
  ss << Number;
  return ss.str();
}
int ToInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
long long ToLLInt(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
bool IsVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
    return true;
  return false;
}
bool IsConst(char ch) {
  if (isalpha(ch) && !IsVowel(ch)) return true;
  return false;
}
bool IsPrime(int w) {
  if (w % 2 == 0) return false;
  for (int q = 3; q * q <= w; q += 2) {
    if (w % q == 0) return false;
  }
  return true;
}
const int MAX = 1e6 + 7;
const int MOD = 1e9 + 7;
const int inf = (1 << 31) - 1;
const long long int INF = (1LL << 63) - 1LL;
char s[MAX];
long long int a[MAX];
int main(int argc, const char *argv[]) {
  long long int n;
  scanf("%lld", &n);
  getchar();
  gets(s + 1);
  for (int j = 1; j < n + 1; j++) scanf("%lld", &a[j]);
  long long int i = 1, cnt = 0;
  while (i) {
    if (s[i] == '>')
      i += a[i];
    else
      i -= a[i];
    if (i <= 0 || i > n || cnt > 1e6) break;
    cnt++;
  }
  if (i >= 1LL && i <= n)
    printf("INFINITE\n");
  else
    printf("FINITE\n");
}
