#include <queue>
#include <iostream>
#include <algorithm>
using namespace std;
int m, n, d[559], e[559]; bool canvis[559], vis[559];
int main() {
	while (cin >> m, m) {
		cin >> n;
		fill(d, d + 555, 0);
		for (int i = 1; i <= n; i++) cin >> d[i];
		for (int i = 0; i < 555; i++) {
			int p = i + d[i];
			p = min(p, n + 1);
			p = max(p, 0);
			e[i] = p;
		}
		queue<int> que1; que1.push(0);
		fill(canvis, canvis + 555, false); canvis[0] = true;
		while (!que1.empty()) {
			int u = que1.front(); que1.pop();
			for (int i = 1; i <= m; i++) {
				int t = e[u + i];
				if (!canvis[t]) {
					canvis[t] = true;
					que1.push(t);
				}
			}
		}
		bool ret = true;
		for (int i = 0; i <= n + 1; i++) {
			if (!canvis[i]) continue;
			fill(vis, vis + 555, false); vis[i] = true;
			queue<int> que2; que2.push(i);
			while (!que2.empty()) {
				int u = que2.front(); que2.pop();
				for (int j = 1; j <= m; j++) {
					int t = e[u + j];
					if (!vis[t]) {
						vis[t] = true;
						que2.push(t);
					}
				}
			}
			if (!vis[n + 1]) ret = false;
		}
		cout << (ret ? "OK" : "NG") << endl;
	}
	return 0;
}