#include <iostream>
#include <vector>
#include <cstring>
using namespace std;


int M, N, D[256];
bool G[256][256];


int main()
{
	for(; cin >> M && M; ) {
		memset(G, false, sizeof G);

		cin >> N;

		for(int i = 1; i <= N; i++) {
			cin >> D[i];
		}

		for(int i = 0; i <= N; i++) {
			for(int j = 1; j <= M; j++) {
				if(i+j >= N+1) G[i][N+1] = true;
				else G[i][max(0, min(i+j+D[i+j], N+1))] = true;
			}
		}

		for(int i = 0; i <= N+1; i++) {
			for(int j = 0; j <= N+1; j++) {
				for(int k = 0; k <= N+1; k++) {
					G[i][j] |= (G[i][k] && G[k][j]);
				}
			}
		}

		bool res = G[0][N+1];
		for(int i = 1; i <= N; i++) {
			res &= (G[0][i] ? G[i][N+1] : true);
		}
		
		cout << (res ? "OK" : "NG") << endl;
	}
}