#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;

const int MAXN = 10;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int bx[4] = {0, 1, 0, 1};
int by[4] = {1, 0, 1, 0};


int n;
int sx, sy;
int spx[12], spy[12];

bool dfs(int cx, int cy, int con) {
    //cout << cx << ", " << cy << " (" << con << ")" << endl;
    if (con == n) return true;
    for (int dir = 0; dir < 4; ++dir) {
        for (int bi = -1; bi <= 1; ++bi) {
            int nx = cx + dx[dir]*2 + bx[dir]*bi;
            int ny = cy + dy[dir]*2 + by[dir]*bi;
            if (nx < 0 || nx >= MAXN || ny < 0 || ny >= MAXN) continue;
            if (max( abs(nx-spx[con]), abs(ny-spy[con]) ) > 1 ) continue;
            if ( dfs(nx, ny, con+1) ) return true;
        }
    }
    return false;
}

int main() {
    while (cin >> sx >> sy >> n) {
        if (sx == 0 && sy == 0) break;
        for (int i = 0; i < n; ++i) cin >> spx[i] >> spy[i];
        if (dfs(sx, sy, 0)) puts("OK");
        else puts("NA");
    }
}
