#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr,__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int pdx[] = {-1, 0, 1, -2, 2, -2, 2, -2, 2, -1, 0, 1};
const int pdy[] = {-2, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 2};
const int wdx[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
const int wdy[] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};

int main() {
    int x, y;
    while (cin >> x >> y, x|y) {
        int n;
        cin >> n;
        vector<pii> water(n);
        REP(i, n) {
            int wx, wy;
            cin >> wx >> wy;
            water[i] = {wx, wy};
        }
        bool G[10][10] = {};
        queue<pii> que;
        que.push({x, y});
        que.push({-1, -1});
        G[y][x] = true;
        int cnt = 0;
        while (1) {
            pii p = que.front(); que.pop();
            int x = p.first, y = p.second;
            if (x == -1 && y == -1) {
                if (que.empty()) {
                    cout << (cnt == n ? "OK" : "NA") << endl;
                    break;
                }
                que.push({-1, -1});
                cnt++;
                continue;
            }
            REP(i, 12) {
                int px = x + pdx[i], py = y + pdy[i];
                if (0 <= px && px < 10 && 0 <= py && py < 10) {
                    REP(j, 9) {
                        int wx = water[cnt].first + wdx[j], wy = water[cnt].second + wdy[j];
                        if (px == wx && py == wy) {
                            if (!G[py][px]) {
                                G[py][px] = true;
                                que.push({px, py});
                            }
                        }
                    }
                }
            }
        }
    }
}