#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;
int n;
int fie[11][11];
pair<int,int> sxy[11];
int dx[]={2,2,2,1,1,0,0,-1,-1,-2,-2,-2};
int dy[]={-1,0,1,2,-2,2,-2,2,-2,-1,0,1};
struct state{
  int x,y,co;
  state(int x,int y,int co):x(x),y(y),co(co){}
};
void fiemake(int co){
  int x=sxy[co].first;
  int y=sxy[co].second;
  memset(fie,0,sizeof(fie));
  int fx[]={1,0,-1,0,1,-1,1,-1,0};
  int fy[]={0,1,0,-1,-1,1,1,-1,0};
  for(int i=0;i<9;i++){ 
    if(x+fx[i] < 0 || x + fx[i] >=10 || y+fy[i] < 0 || y + fy[i] >=10 ) continue;
    fie[x+fx[i]][y+fy[i]]=1; 
  }
  /*  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++) cout << fie[j][i];
    cout << endl;
    }*/
}
int solve(int x,int y){
  queue <state> q;
  q.push( state(x,y,0) );
  int co;
  while(!q.empty()){
    state p = q.front(); q.pop();
    co = p.co;
    if(co>=n) return n;
    fiemake(co);
    for(int i=0;i<12;i++){
      int nx = p.x + dx[i];
      int ny = p.y + dy[i];
      //cout << nx <<" "<< ny << endl;
      if(nx < 0 || nx >=10 || ny < 0 || ny>=10) continue;
      if(fie[nx][ny]==0) continue;
      q.push( state(nx,ny,co+1) );
      //  cout << nx <<" "<< ny << endl;
    }
    // sleep(1);
  }
  return co;
}
main(){
  while(1){
    int px,py;
    cin >> px >> py;
    if(px==0 && py==0) break;
    cin >> n;
    for(int i=0;i<n;i++) cin >> sxy[i].first >> sxy[i].second;
    int res=solve(px,py);
    if(res < n) printf("NA\n");
    else printf("OK\n");
  }
}