#include<iostream>
#include<queue>
#include<cstring>
using namespace std;

int x,y;
int n;
int maze[100][100][11];//y,x,n
bool d[100][100][11];//y,x,n
int dx[] = {-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
int dy[] = {-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
int a,b;
struct P{
  int f,s,c;
  P(int f,int s,int c):f(f),s(s),c(c) {};
};

int bfs(){

  queue < P > que;
  que.push( P(y,x,0) );
  d[y][x][0] = true;
  P p = que.front();

  while( !que.empty() ){
    p = que.front(); que.pop();
 
    for(int i=0;i<12;i++){
      int nx = p.s + dx[i];
      int ny = p.f + dy[i];
      int cnt = p.c;

      if(nx >= 0 && ny >= 0 && nx <= 9 && ny <= 9 && maze[ny][nx][cnt] == 1){
	d[ny][nx][cnt+1] = true;
	que.push( P(ny,nx,cnt+1) );
      }
    }

  }
  return p.c;
}

int main(){

  while(true){
    cin >> x >> y;
    if(!x && !y) break;

    memset(maze,0,sizeof(maze));
    memset(d,false,sizeof(d));

    cin >> n;
    for(int i=0;i<n;i++){
      cin >> a >> b;
      for(int j=a-1;j<=a+1;j++){
	if(j < 0 || j > 9) continue;
	for(int l=b-1;l<=b+1;l++){
	  if(l < 0 || l > 9) continue;
	  maze[l][j][i] = 1;
	}
      }
    }

    bool ans;
    if(bfs() == n) ans = true;
    else ans = false;

    if(ans) cout << "OK\n";
    else cout << "NA\n";

  }
}