#include<iostream>
#include<vector>
#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(){}
	//bool vis;
	vector< pair< int, vector< Point > > > vId;
	/* »ÌêÉ éXvN[Ì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 DFS(int id, Node * p){
	int index = -1;

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

	for(unsigned int i = 0; i < p->vId[index].second.size(); ++i){
		int ei = p->vId[index].second[i].i;
		int ej = p->vId[index].second[i].j;
		Node * nextPoint = &E[ei][ej];

		if( id+1 >= n )
			return true;
		else{
			if( DFS( id+1, nextPoint ) )
				return true;
		}

	}
	return false;
}

/*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();
			//E[i][j].vis = false;
		}
	}
}

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

void SetEdges(){
	const int di[] = { 0, 1, 2,2,2,1,0,-1,-2,-2,-2,-1};
	const int dj[] = {-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)
							E[i][j].vId[m].second.push_back( Point(ti, tj) );
				}
			}
		}
	}
}
void SetSprinclar(int id, int i, int j){
	const int di[] = {0, 0, 1,1,1,0,-1,-1,-1};
	const int dj[] = {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 == 0 && py == 0 ) 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 << ( DFS(0, &E[py+2][px+2] ) ? "OK\n" : "NA\n" );
	}
	return 0;
}

Measured memory_bytes: 0