#include <iostream>
using namespace std;


int spx[10];
int spy[10];
int n;
bool flag = false;


bool spRange(int x, int y, int i){
	int dx[9] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 };
	int dy[9] = { 0, 0, 1, 1, 1, 0, -1, -1, -1 };
	for (int j = 0; j < 9; j++)
		if (x == spx[i] + dx[j] && y == spy[i] + dy[j])	return true;
	return false;
}


void solve(int x, int y, int i){
	
	//cout << x << ' ' << y << ' ' << i << endl;
	if (i == n){
		flag = true;
		return;
	}

	int X;
	int Y;
	int dx[12] = { 2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2 };
	int dy[12] = { 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2, -1 };
	for (int j = 0; j < 12; j++){
		X = x + dx[j];
		Y = y + dy[j];
		if ((0 <= X && X <= 9) && (0 <= Y && Y <= 9)){
			if (spRange(X, Y, i)) solve(X, Y, 1+i);
		}
	}
}


int main(){
	int px, py;

	while (cin >> px >> py, (px || py) != 0){
		cin >> n;
		for (int i = 0; i < n; i++){
			cin >> spx[i] >> spy[i];
		}
		solve(px, py, 1);
		if (flag) cout << "OK" << endl;
		else cout << "NA" << endl;
		flag = false;
	}

	return 0;
}