/*
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

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

const int sx[]={ 0, 1,-1, 0, 0, 1, 1,-1,-1};
const int sy[]={ 0, 0, 0, 1,-1, 1,-1, 1,-1};

class NODE{
public:
	int x;
	int y;
	int pos;
};

bool check(int x,int y){
	return (x>=0 && x<10 && y>=0 && y<10);
}

int main(){
	int x,y,n,a,b;
	NODE q,qt;
	vector<int> t;
	while(cin >> x >> y && (x || y) ){
		bool flag = false;
		vector<int> all[10][10];
		cin >> n;
		rep(i,n){
			cin >> a >> b;
			rep(j,9){
				if(check(a+sx[j],b+sy[j]))
					all[a+sx[j]][b+sy[j]].push_back(i+1);
			}
		}
		queue<NODE> Q;
		q.x=x;q.y=y;
		q.pos=0;
		Q.push(q);
		while(Q.size()){
			q = Q.front();Q.pop();
			if(q.pos == n){
				if(n)flag = true; // if(n)ÈÌÍT@ª0RÌP[XÎôµÄBÀÛ^¦çêÄé©ª©çÈ¢¯ÇB
			}
			rep(i,12){
				if(check(q.x+dx[i],q.y+dy[i])){
					t = all[q.x+dx[i]][q.y+dy[i]];
					if(count(t.begin(),t.end(),q.pos+1)){
						qt.x = q.x+dx[i];
						qt.y = q.y+dy[i];
						qt.pos = q.pos+1;
						Q.push(qt);
					}
				}
			}
		}
		cout << (flag?"OK":"NA") << endl;
	}
} 
*/

#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef pair<P,int> PP;

string split(string delim,string str){
	string res="";
	str += delim;
	for(int i=0;i<str.size();i++){
		for(int j=1;i+j<=str.size();j++){
			if(str.substr(i,j).find_first_of(delim) != string::npos){
				//cout << str.substr(i,j) << endl;
				if(str.substr(i,j-1).size() > 0 ){
					int num;
					sscanf(str.substr(i,j-1).c_str(),"%d",&num);
					res+=num+'0';
					//res.push_back(str.substr(i,j-1));

				}
				i+=j-1;
				break;
			}
		}
	}

	return res;
}

bool bfs(queue<P> fountain,int x,int y){

	const int t[][2] = {{-1,-2},{0,-2},{1,-2},{2,-1},{2,0},{2,1},{1,2},{0,2},{-1,2},{-2.-1},{-2,0},{-2,1}};
	int visited[10][10];
	memset(visited,0,sizeof(visited));

	queue<PP> pyon;
	pyon.push(PP(P(x,y),0));

	int upper = 0;
	//bool isok = false;
	while(!fountain.empty()){
		int fx = fountain.front().first;
		int fy = fountain.front().second;
		fountain.pop();
		//isok = false;
		while(!pyon.empty()){
			int px = pyon.front().first.first;
			int py = pyon.front().first.second;
			int c = pyon.front().second;
			if(upper == c) pyon.pop();
			else { upper++; memset(visited,0,sizeof(visited)); break; }
			
			for(int i=0;i<12;i++){
				int dx = px + t[i][0];
				int dy = py + t[i][1];

				if(dx < 0 || dx > 9 || dy < 0 || dy > 9) continue;
				if((fx-1 <= dx && dx <= fx+1) && (fy-1 <= dy && dy <= fy+1)){
					if(visited[dy][dx] == 1) continue;
					pyon.push(PP(P(dx,dy),c+1));
					visited[dy][dx] = 1;
					//isok=true;
					if(fountain.empty()) return true;
				}
			}
		}
		//if(!isok) return false;
	}

	return false;
}


int main(){
	string str;
	int px,py;
	while(~scanf("%d %d",&px,&py)){
		if(px == 0 && py == 0) break;
		int n;
		scanf("%d",&n);
		if(n==0){
			cout << "NA" << endl;
			continue;
		}
		queue<P> fountain;
		for(int i=0;i<n;i++){
			int x,y;
			scanf("%d %d",&x,&y);
			fountain.push(P(x,y));
		}

		printf("%s\n",bfs(fountain,px,py) ? "OK" : "NA");
	}
}