#include <iostream>
using namespace std;
int t[255],f[255],g[255],n,m;
int hantei(int x,int d) {
	int i,j,c,a;
	for (i=0;i<=n+1;i++) f[i]=0; f[x]=1; c=1;
	while(c==1) {
	c=0;	
	for (i=0;i<=n;i++) {
		if (f[i]==1) {
			for (j=i+1;j<=i+m;j++) {
				a=j+t[j];
				if (a<0) a=0; if (a>n+1) a=n+1;
				if (d==1 && a==n+1) return 2;
				if (f[a]==0) { f[a]=1; c=1;}
			}
			f[i]=2;
		}
	  }
  }
  return 0;	
  }
int main() {
int i,c;
 while(cin >> m && m!=0) {
	 cin >> n;
	 for (i=1;i<=n;i++) cin >> t[i];
	 c=hantei(0,0);
	 for (i=0;i<=n;i++) g[i]=f[i];
	 for (i=0;i<=n;i++) if (g[i]>0) {c=hantei(i,1); if (c==0) break;}
	 if (c==0) cout << "NG"; else cout << "OK";
	 cout << endl;
	} 			   
 return 0;
 } 