#include <cstdio>
#include <cstring>
#include <queue>

using namespace std;

#define CHECK(X) (0<=(X)&&(X)<=9)

struct Pyon {
	int x,y;
	int next;
	Pyon(int _x,int _y,int _next);
};

Pyon::Pyon(int _x,int _y,int _next) {
	x=_x,y=_y,next=_next;
}

int dx[]={-1,0,1,2,2,2,1,0,-1,-2,-2,-2};
int dy[]={2,2,2,1,0,-1,-2,-2,-2,-1,0,1};

int main() {
	int park[10][10];
	int px,py,n;
	while(scanf("%d %d",&px,&py),px||py) {
		scanf("%d",&n);
		memset(park,0,sizeof(park));
		for(int i=1;i<=n;i++) {
			int sx,sy;
			scanf("%d %d",&sx,&sy);
			for(int j=-1;j<=1;j++) {
				for(int k=-1;k<=1;k++) {
					if((j||k)&&CHECK(sx+j)&&CHECK(sy+k)) {
						park[sx+j][sy+k]=i;
					}
				}
			}
		}
		queue<Pyon> que;
		que.push(Pyon(px,py,1));
		bool ok=false;
		if(n==0) {printf("OK\n");continue;}
		while(!que.empty()&&!ok) {
			Pyon p=que.front();que.pop();
			for(int i=0;i<12&&!ok;i++) {
				int nx=p.x+dx[i],ny=p.y+dy[i];
				if(CHECK(nx)&&CHECK(ny)&&park[nx][ny]==p.next) {
					if(p.next==n) ok=true;
					else que.push(Pyon(nx,ny,p.next+1));
				}
			}
		}
		printf(ok?"OK\n":"NA\n");
	}
	return 0;
}