#include <cstdio>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
#define all(c) begin(c), end(c)

int n;
int x,y;
int wx[10], wy[10];

inline bool in(int x,int y){
    return 0<=x && x<10 && 0<=y && y<10;
}

bool solve(){
    vector<pair<int,int>> cur{make_pair(x,y)};
    rep(l,n){
        vector<pair<int,int>> next;
        int dx1[]={-1,-1,-1,0,0,0,1,1,1};
        int dy1[]={0,1,-1,0,1,-1,0,1,-1};
        int dx2[]={-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
        int dy2[]={-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
        rep(i,cur.size()){
            int x=cur[i].first, y=cur[i].second;
            rep(j,9){
                int x1=wx[l]+dx1[j], y1=wy[l]+dy1[j];
                rep(k,12){
                    int x2=x+dx2[k], y2=y+dy2[k];
                    if(x1==x2 && y1==y2 && in(x1,y1)){
                        next.emplace_back(x1,y1);
                    }
                }
            }
        }
        sort(all(next));
        next.erase(unique(all(next)),next.end());
        cur=next;
        if(cur.size()==0) return false;
    }
    return true;
}

int main(){
    while(scanf("%d%d",&x,&y)!=EOF && x|y){
        scanf("%d",&n);
        rep(i,n)scanf("%d%d",&wx[i],&wy[i]);
        puts(solve()?"OK":"NA");
    }
}