#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a) for( int i = 0; i != (a); ++i )
#define repi(i,a,b) for( int i = (a); i != (b); ++i )

int ma, n;
int d[260];
bool dp[260][260];

int main()
{
	while( scanf( "%d", &ma ), ma )
	{
		scanf( "%d", &n );
		memset( dp, false, sizeof( dp ) );
		repi( i, 1, n+1 )
			scanf( "%d", d+i );
		d[0] = d[n+1] = 0;

		rep( i, n+1 )
		{
			repi( j, 1, ma+1 )
			{
				if( i+j > n+1 )
					break;
				dp[i][std::max( std::min( i+j+d[i+j], n+1 ), 0 )] = true;
			}
		}

		rep( k, n+2 )
			rep( i, n+2 )
				rep( j, n+2 )
					if( dp[i][k] && dp[k][j] )
						dp[i][j] = true;

		bool fl = true;
		rep( i, n+1 )
			if( dp[0][i] && !dp[i][n+1] )
				fl = false;
		
		puts( fl ? "OK" : "NG" );
	}

	return 0;
}