#include <set>
#include <queue>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

int sy,sx;
int n;
vector<pair<int,int> > sp;

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

class Situation{
public:
	int x,y,num;

	bool operator<(const Situation &s)const{
		return s.num < this->num;
	}
};

// y,x,numÌêÉBµ½©Ç¤©
bool reached[10][10][10];

int main(){

	while(cin>>sx>>sy&&!(sy==0&&sx==0)){
		memset(reached,0,sizeof(reached));
		sp.clear();
		cin>>n;
		for(int i = 0; i < n; i++){
			int cx,cy;
			cin>>cx>>cy;
			sp.push_back(make_pair(cy,cx));
		}
		int num=1;
		// bfs
		queue<Situation> *prv=new queue<Situation>();
		queue<Situation> *nxt=new queue<Situation>();
		// ú
		for(int i = 0; i < 12; i++){
			Situation init;
			init.x=sx+dx[i];
			init.y=sy+dy[i];
			if(init.x>=0&&init.y>=0&&init.x<10&&init.y<10){
				if(sp[0].first-1<=init.y&&sp[0].first+1>=init.y
					&&sp[0].second-1<=init.x&&sp[0].second+1>=init.x){
						reached[init.y][init.x][0]=true;
						prv->push(init);
				}
			}
		}
		bool f=false;
		int cnt=0;

		while(prv->size()){
			while(prv->size()){
				Situation cp=prv->front();
				prv->pop();
				for(int i = 0; i < 12; i++){
					Situation init;
					init.x=cp.x+dx[i];
					init.y=cp.y+dy[i];
					init.num=num;
					if(init.x>=0&&init.y>=0&&init.x<10&&init.y<10){
						if(sp[num].first-1<=init.y&&sp[num].first+1>=init.y
							&&sp[num].second-1<=init.x&&sp[num].second+1>=init.x){
								//if(reached[init.y][init.x][num]){
								//	// [vµ½çI¹
								//	f=true;
								//	break;
								//}
//								reached[init.y][init.x][num]=true;
								nxt->push(init);
						}
					}
				}
				if(f)
					break;
			}
			queue<Situation> *tq=new queue<Situation>();
			set<Situation> sets;
			while(nxt->size()){
				Situation ss=nxt->front();
				nxt->pop();
				tq->push(ss);
				sets.insert(ss);
			}

			for(set<Situation>::iterator it = sets.begin(); sets.end()!=it; it++){
				Situation ss=*it;
				if(reached[ss.y][ss.x][num]){
					f=true;
					break;
				}
				else{
					reached[ss.y][ss.x][num]=true;
				}
			}

			swap(prv,tq);
			num+=1;
			num%=n;
			if(f)
				break;
		}
		if(f){
			cout<<"OK"<<endl;
		}
		else{
			cout<<"NA"<<endl;
		}
	}

	return 0;
}