#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<string.h>

using namespace std;

bool field[11][9][9];
bool field_initialize[11][9][9]={0};

int sp[3]={0,1,-1};

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



struct kaeru_xy{
    int x;
    int y;
    int now;
};

void set_field(int x, int y, int now){
    for(int i=0; i<3; i++){
        for(int j=0; j<3; j++){
            if(0<=x+sp[i]&&x+sp[i]<9&&0<=y+sp[j]&&y+sp[j]<9)field[now][x+sp[i]][y+sp[j]]=true;
        }
    }
}





int main(){
    
    
    
    
    int px,py;
    while(cin>>px>>py){
        if(px==0&&py==0)break;
        kaeru_xy kaeru;
        kaeru.x=px;
        kaeru.y=py;
        kaeru.now=0;
        queue<kaeru_xy> BFS;
        BFS.push(kaeru);
        
        
        
        memcpy(field, field_initialize, sizeof(bool)*81*11);
        int n;
        cin>>n;
        
        for(int i=0; i<n; i++){
            int tx,ty;
            cin>>tx>>ty;
            set_field(tx, ty, i);
            
            
        }
        int flag =0;
        while(!BFS.empty()){
            kaeru=BFS.front();
            if(kaeru.now==n){
                flag=1;
                break;
            }
            
            BFS.pop();
            for(int i=0; i<12; i++){
                if(0<=kaeru.x+k_move[0][i]&&kaeru.x+k_move[0][i]<9&&0<=kaeru.y+k_move[1][i]&&kaeru.y+k_move[1][i]<9){
                    if(field[kaeru.now%n][kaeru.x+k_move[0][i]][kaeru.y+k_move[1][i]]){
                        kaeru_xy next_k;
                        next_k.x=kaeru.x+k_move[0][i];
                        next_k.y=kaeru.y+k_move[1][i];
                        next_k.now=kaeru.now+1;
                        BFS.push(next_k);
                    }
                }
            }
        }
        if(flag==1)cout<<"OK"<<endl;
        else cout<<"NA"<<endl;
        
        
    }
}