#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define P pair<int, int>
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
const int MAX_N = 260;
const int INF = 1e9;

int main(){
  int M, N, D[MAX_N], G[MAX_N][MAX_N];
  while(cin >>M && M){
    memset(D, 0, sizeof(D));
    memset(G, 0, sizeof(G));
    cin >>N;
    FOR(i, 1, N + 1) cin >>D[i];
    REP(i, N + 2){
      FOR(j, i + 1, min(N + 2, i + M + 1)){
        int next = min(N + 1, max(0, j + D[j]));
        G[i][next] = 1;
      }
    }
    REP(k, N + 2) REP(i, N + 2) REP(j, N + 2) if(G[i][k] && G[k][j]) G[i][j] = true;
    bool f = true;
    REP(i, N + 1) if(G[0][i] && !G[i][N + 1]) f = false;
    cout <<(f ? "OK" : "NG") <<endl;
  }
  return 0;
}