#include<iostream>
#include<iomanip>
#include<vector>
#include<sstream>
#include<queue>

#define MAX 10

using namespace std;

struct Point{
	int i, j;
	Point():i(0),j(0){}
	Point(int i,int j):i(i),j(j){}
	bool operator==(const Point &t){
		return (i == t.i && j == t.j);
	}
};
struct Node{
	Node(){}
	vector< pair< int, vector< Point > > > vId;
	/* »ÌêÉ éXvN[Ìzñ(øÊÍÍÜÞ) < id, Ìm[hÊuÌzñ > */
};

struct QInfo{
	QInfo():id(0),p(NULL),st(){}
	QInfo(int id, Node *p, Point tp):id(id),p(p),st(tp.i,tp.j){}
	int id;
	Node *p;
	Point st;
};

int n;
Node E[MAX+4][MAX+4];

bool BFS(int si, int sj){
	bool first = true;
	queue< QInfo > q;
	q.push( QInfo(0, &E[si][sj], Point(-1, -1)) );

	while( !q.empty() ){
		int index = -1;
		QInfo p = q.front();

		q.pop();

		// search id
		for(unsigned int i = 0; i < p.p->vId.size(); ++i){
			if( p.id == p.p->vId[i].first ){
				index = i;
				break;
			}
		}
		if( index < 0 )
			return false;

		// add next
		for(unsigned int i = 0; i < p.p->vId[index].second.size(); ++i){
			int ei = p.p->vId[index].second[i].i;
			int ej = p.p->vId[index].second[i].j;
			Node * nextPoint = &E[ei][ej];
			if( p.id+1 > n && Point( ei, ej ) == p.st )
				return true;
			q.push( QInfo(
				(p.id+1 > n ? 1 : p.id+1),
				nextPoint,
				(first ? Point(ei, ej) : p.st ) )
				);
		}
		first = false;
	}
	return false;
}
void ResetMap(){
	for(int i = 0; i < sizeof(E)/sizeof(*E); ++i)
		for(int j = 0; j < sizeof(*E)/sizeof(**E); ++j)
			E[i][j].vId.clear();
}

inline bool inRange(int min, int t, int max){ return (min <= t && t < max); }

void SetEdges(){
	const int di[12] = { 0, 1, 2,2,2,1,0,-1,-2,-2,-2,-1};
	const int dj[12] = {-2,-2,-1,0,1,2,2, 2, 1, 0,-1,-2};

	for(int i = 2; i < MAX+2; ++i){
		for(int j = 2; j < MAX+2; ++j){
			for(unsigned int m = 0; m < E[i][j].vId.size(); ++m){
				int id = E[i][j].vId[m].first;
				
				for(int k = 0; k < sizeof(di)/sizeof(*di); ++k){
					int ti = i+di[k];
					int tj = j+dj[k];

					if( !(inRange(2, ti, MAX+2) && inRange(2, tj, MAX+2)) )
						continue;
					
					for(unsigned int l = 0; l < E[ti][tj].vId.size(); ++l)
						if( E[ti][tj].vId[l].first == (id + 1 > n ? 1 : id + 1) )
							E[i][j].vId[m].second.push_back( Point(ti, tj) );
				}
			}
		}
	}
}
void SetSprinclar(int id, int i, int j){
	const int di[9] = {0,0,1,1,1,0,-1,-1,-1};
	const int dj[9] = {0,-1,-1,0,1,1,1,0,-1};
	vector<Point> tmp;
	for(int m = 0; m < sizeof(di)/sizeof(*di); ++m)
		E[i+di[m]][j+dj[m]].vId.push_back( make_pair(id,tmp) );
}
int main(void){
	while( true ){
		int x, y, px, py;
		vector<Point> tmp;

		cin >> px >> py;
		if( !(px || py) ) break;

		ResetMap();

		E[py+2][px+2].vId.push_back( make_pair(0, tmp) );
		
		cin >> n;
		for(int i = 1; i <= n; ++i){
			cin >> x >> y;
			SetSprinclar( i, y+2, x+2 ); 
		}
		SetEdges();
		
		cout << ( BFS( py+2, px+2 ) ? "OK\n" : "NA\n" );
	}
	return 0;
}