#include <iostream>

using namespace std;

struct Point{
	int x,y;
	Point( int dx, int dy ) : x(dx), y(dy) {}
	Point(){}
};

Point jump[12] = { Point( -1, -2 ),Point( 0, -2 ), Point( 1, -2 ),
	Point( 2, -1 ), Point( 2, 0 ), Point( 2, 1 ),
	Point( -1, 2 ), Point( 0, 2 ), Point( 1, 2 ),
	Point( -2, -1 ), Point( -2, 0 ), Point( -2, 1 ) };

bool saiki( const Point& k, int n, const Point* s, int t ){
	if( t == n ) return true;
	bool stage[10][10];

	for( int i = 0;i < 10;i++ ){
		for( int j = 0;j < 10;j++ ){
			stage[i][j] = false;
		}
	}

	for( int i = 0;i < 3;i++ ){
		for( int j = 0;j < 3;j++ ){
			if( i + s[t].x - 1 > -1 && j + s[t].y - 1 > -1 && i + s[t].x - 1 < 10 && j + s[t].y - 1 < 10 ) stage[i + s[t].x - 1][j + s[t].y - 1] = true;
		}
	}

	for( int i = 0;i < 12;i++ ){
		if( k.x + jump[i].x > -1 && k.y + jump[i].y > -1 && k.y + jump[i].y < 10 && k.x + jump[i].x < 10 ) if( stage[k.x + jump[i].x][k.y + jump[i].y] ) if( saiki( Point( k.x + jump[i].x, k.y + jump[i].y ), n, s, t + 1 ) ) return true;
	}

	return false;
}


int main(int argc, char const* argv[])
{
	Point k;
	int n;
	Point s[10];

	while( cin >> k.x >> k.y && k.x != 0 && k.y != 0 ){
		cin >> n;
		for( int i = 0;i < n;i++ ) cin >> s[i].x >> s[i].y;

		if( saiki( k, n, s, 0 ) ) cout << "OK" << endl;
		else cout << "NA" << endl;
	}
	return 0;
}