#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999



int data[10][10];

void jump(int y,int x){
    int dy[]={-2,-2,-2,-1,0,1,2,2,2,1,0,-1};
    int dx[]={-1,0,1,2,2,2,1,0,-1,-2,-2,-2};
    rep(i,12){
        int ddy = y+dy[i];
        int ddx = x+dx[i];
        if(  ddx>=0 && ddy>=0 && ddx<10 && ddy<10  ){
            data[ddy][ddx] = -1;
        }
    }
}


vector<pii> spr(int y,int x){
    vector<pii> ret;
    for(int i=-1;i<=1;i++){
        for(int j=-1;j<=1;j++){
            int ddy = y+i;
            int ddx = x+j;
            if(  ddx>=0 && ddy>=0 && ddx<10 && ddy<10  ){
                if(data[ddy][ddx]==-1){
                    data[ddy][ddx] = 0;
                    ret.pb(pii(ddy,ddx));
                }
            }
        }
    }
    rep(i,10){
        rep(j,10){
            if(data[i][j]==-1){
                data[i][j]=0;
            }
        }
    }
    return ret;
}

int main(){
    int x,y;
    while(cin>>x>>y){
        if(x==0&&y==0)break;
        rep(i,10)rep(j,10)data[i][j]=0;
        int n;
        cin>>n;
        vector<pii> sp;
        rep(i,n){
            int a,b;
            cin>>a>>b;
            sp.pb(pii(b,a));
        }

        jump(y,x);
        rep(i,n){
            int sy = sp[i].first;
            int sx = sp[i].second;
            vector<pii> pos = spr(sy,sx);
            rep(j,pos.size()){
                int yy = pos[j].first;
                int xx = pos[j].second;
                jump(yy,xx);
            }
        }
        bool f=false;
        rep(i,10){
            rep(j,10){
                if(data[i][j]==-1){
                    f=true;
                }
            }
        }
        if(f)cout<<"OK"<<endl;
        else cout<<"NA"<<endl;
    }
}