#include<iostream>
using namespace std;
bool safe(int x,int y){
  if(x<0||x>9) return false;
  if(y<0||y>9) return false;
  else return true;
}
int main(){
  int x,y,n,xy[10][10],memxy[10][10];
  while(cin>>x>>y){
    if(x==0&&y==0) break;
    cin >> n;
    int dx[n],dy[n];
    for(int i=0;i<n;i++) cin >> dx[i] >> dy[i];
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	xy[i][j] = -1;
	memxy[i][j] = 0;
      }
    }
    for(int i=-1;i<=1;i++){
      if(safe(x+2,y+i)) xy[x+2][y+i] = 0;
      if(safe(x-2,y+i)) xy[x-2][y+i] = 0;
      if(safe(x+i,y+2)) xy[x+i][y+2] = 0;
      if(safe(x+i,y-2)) xy[x+i][y-2] = 0;
    }
    for(int i=0;i<n;i++){
      for(int j=-1;j<=1;j++){
	for(int k=-1;k<=1;k++){
	  if(safe(dx[i]+j,dy[i]+k)){
	    if(xy[dx[i]+j][dy[i]+k]==i){
	      for(int l=-1;l<=1;l++){
		if(safe(dx[i]+j+2,dy[i]+k+l)) memxy[dx[i]+j+2][dy[i]+k+l] = i+1;
		if(safe(dx[i]+j-2,dy[i]+k+l)) memxy[dx[i]+j-2][dy[i]+k+l] = i+1;
		if(safe(dx[i]+j+l,dy[i]+k+2)) memxy[dx[i]+j+l][dy[i]+k+2] = i+1;
		if(safe(dx[i]+j+l,dy[i]+k-2)) memxy[dx[i]+j+l][dy[i]+k-2] = i+1;
	      }
	    }
	  }
	}
      }
      for(int j=0;j<10;j++){
	for(int k=0;k<10;k++) xy[k][j] = memxy[k][j];
      }
    }
    bool ok = false;
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++) if(xy[i][j]==n) ok = true;
    }
    if(ok) cout << "OK" << endl;
    else cout << "NA" << endl;
  }
  return 0;
}