#include <iostream>
#include <map>
#include <functional>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>

int rmax, n;
int d[260];
std::vector<std::set<int> > edges, edges2;

/*
0: テゥツ卍催」ツつ甘・ツ?コテ」ツ??
1~n: テ」ツδ榲」ツつケ
n + 1: テ、ツクツ甘」ツ?古」ツつ?
*/

int check(int idx) {
    idx += d[idx];
    if(idx <= 0) {
        return 0;
    }

    if(idx >= n + 1) {
        return n + 1;
    }

    return idx;
}

int main() {
    while(std::cin >> rmax, rmax) {
        std::cin >> n;

        edges.clear();
        edges.resize(n + 2);
        edges2.clear();
        edges2.resize(n + 2);

        for(int i = 1; i <= n; ++i) {
            std::cin >> d[i];
        }
        for(int i = 0; i <= n; ++i) {
            for(int j = 1; j <= rmax; ++j) {
                int to = check(i + j);

                if(i == to) {
                    continue;
                }
                edges[to].insert(i);
                edges2[i].insert(to);
            }
        }

        /*for(int i = 0; i < edges.size(); ++i) {
            for(std::set<int>::iterator it = edges[i].begin(); it != edges[i].end(); ++it) {
                std::cout << i << " " <<  *it << std::endl;
            }
        }*/

        bool used[260] = {}, used2[260] = {};
        std::queue<int> que;
        {
            que.push(n + 1);
            used[n + 1] = true;
            while(!que.empty()) {
                int p = que.front(); que.pop();

                for(std::set<int>::iterator it = edges[p].begin(); it != edges[p].end(); ++it) {
                    if(!used[*it]) {
                        que.push(*it);
                        used[*it] = true;
                    }
                }
            }
        }

        {
            que.push(0);
            used2[0] = true;
            while(!que.empty()) {
                int p = que.front(); que.pop();

                for(std::set<int>::iterator it = edges2[p].begin(); it != edges2[p].end(); ++it) {
                    if(!used2[*it]) {
                        que.push(*it);
                        used2[*it] = true;
                    }
                }
            }
        }

        bool ok = true;
        for(int i = 0; i <= n + 1; ++i) {
            //std::cout << i << " " << used2[i] << " " << used[i] << std::endl;
            if(used2[i] && !used[i]) {
                ok = false;
                break;
            }
        }

        std::cout << (ok ? "OK" : "NG") << std::endl;
    }
}