#include <stdio.h>
#include <string.h>

const int jmp[12][2] = {
    {-1, -2}, {0, -2}, {1, -2},
    {2, -1}, {2, 0}, {2, 1},
    {1, 2}, {0, 2}, {-1, 2},
    {-2, 1}, {-2, 0}, {-2, -1}
};

int main(void) {
    int sx, sy, n, sprx[10], spry[10];
    int i, j, k, l, x, y, p;
    int wet[2][3][3], (*s)[3], (*t)[3], survive;

    while (scanf("%d%d", &sx, &sy) == 2 && (sx || sy)) {
        scanf("%d", &n);
        for (i = 0; i < n; i++) {
            scanf("%d%d", &(sprx[i]), &(spry[i]));
        }
        memset(wet[0], 0, 9*sizeof(int));
        wet[0][1][1] = 1;
        for (i = 0; i < n; i++) {
            s = wet[i&1];
            t = wet[(i+1)&1];
            memset(t, 0, 9*sizeof(int));
            p = i % n;
            survive = 0;
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 3; k++) {
                    if (s[j][k] == 1) {
                        for (l = 0; l < 12; l++) {
                            x = sx-1+k+jmp[l][0];
                            y = sy-1+j+jmp[l][1];
                            if (0 <= x && x < 10 && 0 <= y && y < 10 &&
                                sprx[p]-1 <= x && x <= sprx[p]+1 &&
                                spry[p]-1 <= y && y <= spry[p]+1) {
                                t[y-spry[p]+1][x-sprx[p]+1] = 1;
                                survive = 1;
                            }

                        }
                    }
                }
            }
            if (!survive) break;
            sx = sprx[p];
            sy = spry[p];
        }
        if (!survive) {
            puts("NA");
        }
        else {
            puts("OK");
        }
    }
    return 0;
}