#include<iostream>
#include<vector>
using namespace std;
	vector<int> x,y;
	int n,a,b,s,t;
int rep(int now,int nx,int ny){
	int px,py,p=0;
	if(now!=-1){
		for(int i=0;i<3;i++)
			for(int j=0;j<3;j++)
				if(nx==x[now]-1+i&&ny==y[now]-1+j)
					p++;
		if(p==0)
			return 0;
	}
	if(now==n-1)
		return 1;
	for(int i=0;i<3;i++){
		px=nx+2;py=ny-1+i;
		if(px>=0&&px<=9&&py>=0&&py<=9){
			if(rep(now+1,px,py))
			return 1;
		}
		px=nx-2;py=ny-1+i;
		if(px>=0&&px<=9&&py>=0&&py<=9){
			if(rep(now+1,px,py))
			return 1;
		}
		px=nx-1+i;py=ny-2;
		if(px>=0&&px<=9&&py>=0&&py<=9){
			if(rep(now+1,px,py))
			return 1;
		}
		px=nx-1+i;py=ny+2;
		if(px>=0&&px<=9&&py>=0&&py<=9){
			if(rep(now+1,px,py))
			return 1;
		}
	}
	return 0;
}
void solve(){
	if(rep(-1,a,b))
	cout<<"OK"<<endl;
	else cout<<"NA"<<endl;
}
int main(){
	while(cin>>a>>b,a||b){
		cin>>n;
		for(int i=0;i<n;i++){
			cin>>s>>t;
			x.push_back(s);
			y.push_back(t);
		}
		solve();
		x.clear();
		y.clear();
	}
	return 0;
}