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

#define REP(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

class State{
public:
	int x,y;
	int cost;

	State(int tx,int ty,int tcost){
		x = tx;
		y = ty;
		cost = tcost;
	}

	bool operator==(const State &st) const {
		return x == st.x && y == st.y && cost == st.cost;
	}
};

queue<State> open;

int n;
char t[10][10][10];
int sdx[] = {-1, 0, 1,-1, 0, 1,-1, 0, 1};
int sdy[] = { 0, 0, 0, 1, 1, 1,-1,-1,-1};
int dx[] =  {-2,-2,-2,-1,-1, 0, 0, 1, 1, 2, 2, 2, 0};
int dy[] =  { 1, 0,-1,-2, 2,-2, 2,-2, 2,-1, 0, 1, 0};

bool contains(State st){
	int size = open.size();
	bool res = false;
	rep(i,size){
		if(open.front() == st) res = true;
		open.push(open.front());
		open.pop();
	}
	return res;
}

void nexts(State st){
	rep(i,13){
		int nx = st.x + dx[i];
		int ny = st.y + dy[i];
		int ncost = (st.cost + 1) % n;

		if(nx>=0 && nx<10 && ny>=0 && ny<10 && t[ny][nx][ncost]){
			State nst(nx,ny,ncost);
			if(!contains(nst)) open.push(nst);
		}
	}
}

void printQueue(void){
	int size = open.size();

	cout<<"[";
	rep(i,size){
		cout<<"["<<open.front().x<<","<<open.front().y<<" : "<<open.front().cost<<"] ";
		open.push(open.front());
		open.pop();
	}
	cout<<endl;
}

int main(void){
	int x,y,sx,sy;

	while(cin>>sx>>sy && (sx||sy)){
		memset(t,0,sizeof(t));

		cin>>n;
		rep(i,n){
			cin>>x>>y;
			rep(j,9){
				int ny = y + sdy[j];
				int nx = x + sdx[j];
				if(nx>=0 && nx<10 && ny>=0 && ny<10) t[ny][nx][i] = 1;
			}
		}

		while(!open.empty()) open.pop();
		State start(sx,sy,-1);
		nexts(start);

		for(int i=0;!open.empty() && i<100000;i++){
			//printQueue();
			State st = open.front(); open.pop();
			nexts(st);
		}

		cout << (open.empty() ? "NA" : "OK") << endl;
	}

	return 0;
}