#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
long d[100005];
int main(){
int n;
char s[100005];
long pos= 0;
bool flag1= true;
bool infinite= false;
vector< long > position;
scanf( "%d", &n );
scanf( "%s", &s );
for( int i= 0; i< n; ++i )
scanf( "%ld", &d[i] );
int i= 0;
position.push_back( pos );
//cout << pos+1 << ' ';
if( s[pos]== '<' ){
cout << "FINITE\n";
return 0;
}
//cout << pos+1 << ' ';
while( true ){
if( s[pos]== '<' ){
pos-= d[pos];
}else{
pos+= d[pos];
}
position.push_back( pos );
++i;
//cout << pos+1 << ' ';
if( pos < 0 || pos >= n )
break;
if( i >= 3 ){
if( position[i]== position[i-2] && position[i-1]== position[i-3] ){
infinite= true;
break;
}
}
}
if( infinite ){
cout << "INFINITE\n";
}else {
cout << "FINITE\n";
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKdHlwZWRlZiBwYWlyPCBpbnQsIGludCA+IHBpaTsKdHlwZWRlZiBwYWlyPCBsbCwgbGwgPiBwbGw7Cgpsb25nIGRbMTAwMDA1XTsKCmludCBtYWluKCl7CgogICAgaW50IG47CiAgICBjaGFyIHNbMTAwMDA1XTsKICAgIGxvbmcgcG9zPSAwOwogICAgYm9vbCBmbGFnMT0gdHJ1ZTsKICAgIGJvb2wgaW5maW5pdGU9IGZhbHNlOwogICAgdmVjdG9yPCBsb25nID4gcG9zaXRpb247CgogICAgc2NhbmYoICIlZCIsICZuICk7CiAgICBzY2FuZiggIiVzIiwgJnMgKTsKCiAgICBmb3IoIGludCBpPSAwOyBpPCBuOyArK2kgKQogICAgICAgIHNjYW5mKCAiJWxkIiwgJmRbaV0gKTsKCiAgICBpbnQgaT0gMDsKICAgIHBvc2l0aW9uLnB1c2hfYmFjayggcG9zICk7CgogICAgLy9jb3V0IDw8IHBvcysxIDw8ICcgJzsKCiAgICBpZiggc1twb3NdPT0gJzwnICl7CiAgICAgICAgY291dCA8PCAiRklOSVRFXG4iOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIC8vY291dCA8PCBwb3MrMSA8PCAnICc7CgogICAgd2hpbGUoIHRydWUgKXsKCiAgICAgICAgaWYoIHNbcG9zXT09ICc8JyApewogICAgICAgICAgICBwb3MtPSBkW3Bvc107CiAgICAgICAgfWVsc2V7CiAgICAgICAgICAgIHBvcys9IGRbcG9zXTsKICAgICAgICB9CgogICAgICAgIHBvc2l0aW9uLnB1c2hfYmFjayggcG9zICk7CiAgICAgICAgICsraTsKCiAgICAgICAgLy9jb3V0IDw8IHBvcysxIDw8ICcgJzsKCiAgICAgICAgaWYoIHBvcyA8IDAgfHwgcG9zID49IG4gKQogICAgICAgICAgICBicmVhazsKCiAgICAgICAgaWYoIGkgPj0gMyApewoKICAgICAgICAgICAgaWYoIHBvc2l0aW9uW2ldPT0gcG9zaXRpb25baS0yXSAmJiBwb3NpdGlvbltpLTFdPT0gcG9zaXRpb25baS0zXSApewogICAgICAgICAgICAgICAgaW5maW5pdGU9IHRydWU7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICB9CgogICAgaWYoIGluZmluaXRlICl7CiAgICAgICAgY291dCA8PCAiSU5GSU5JVEVcbiI7CiAgICB9ZWxzZSB7CiAgICAgICAgY291dCA8PCAiRklOSVRFXG4iOwogICAgfQoKCn0=