
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <complex>
#include <cctype>
#include <cassert>
#include <sstream>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <deque>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;

int M, N;
int d[260];
bool done[260], visited[260];
vector<int> g[260];

int dfs(int p) {
	if (visited[p]) return 0;
	if (p == N + 1) return 1;
	
	visited[p] = true;
	
	REP(i, g[p].size()) if (dfs(g[p][i])) return 1;
	return 0;
}

int main() {
	while (cin >> M, M) {
		cin >> N;
		
		memset(d, 0, sizeof(d));
		REP(i, N) scanf("%d", d + i + 1);
		
		REP(i, 260) g[i].clear();
		
		REP(i, N + 1) {
			memset(done, 0, sizeof(done));
			FOR(j, 1, M + 1) {
				int p = min(i + j, N + 1);
				p = max(0, min(p + d[p], N + 1));
				done[p] = true;
			}
			
			REP(j, N + 2) if (done[j]) g[i].push_back(j);
		}
		
		bool ans = true;
		
		memset(done, 0, sizeof(done));
		
		queue<int> que;
		que.push(0);
		done[0] = true;
		
		while (!que.empty()) {
			int p = que.front(); que.pop();
			
			memset(visited, 0, sizeof(visited));
			if (!dfs(p)) ans = false;
			
			REP(i, g[p].size()) if (!done[g[p][i]]) {
				done[g[p][i]] = true;
				que.push(g[p][i]);
			}
		}
		
		puts(ans ? "OK" : "NG");
	}
	return 0;
}