#include <bits/stdc++.h>

using namespace std;

int CoordinatesOfSprinkler[10][2];
int N;


bool hasWaterInSprinklerRange(int px, int py, int node) {
	int dx[] = { 0,-1,0,1,-1,1,-1,0,1 };
	int dy[] = { 0,-1,-1,-1,0,0,1,1,1 };

	int currentX, currentY;
	for (int i = 0; i < 9; i++) {
		currentX = CoordinatesOfSprinkler[node][0] + dx[i];
		currentY = CoordinatesOfSprinkler[node][1] + dy[i];

		if (currentX < 0 || currentX > 9 || currentY < 0 || currentY > 9) {
			continue;
		}

		if (currentX == px && currentY == py) {
			return true;
		}
	}

	return false;
}

bool surviveMapDataByFrog(int x, int y,int node) {
	//cout << "px:" << x << "  py:" << y << endl;
	//cout << "node:" << node << endl;
	if (node == N) {
		return true;
	}

	int dx[] = { -2,-2,-2,-1,0,1,2,2,2,-1,0,1 };
	int dy[] = { -1,0,1,-2,-2,-2,-1,0,1,2,2,2 };
	int currentPX, currentPY;
	bool hasWater;

	for (int i = 0; i < 12; i++) {
		currentPX = x + dx[i];
		currentPY = y + dy[i];

		if (currentPX < 0 || currentPX > 9 || currentPY < 0 || currentPY > 9) {
			continue;
		}

		hasWater = false;
		if (hasWaterInSprinklerRange(currentPX, currentPY, node)) {
			hasWater = true;
		}
		if (hasWater) {
			if (surviveMapDataByFrog(currentPX, currentPY, node + 1)) {
				return true;
			}
		}
	}
	return false;
}

int main() {
	int px, py;
	bool result;

	while (cin >> px >> py, (px | py)) {
		memset(CoordinatesOfSprinkler, 0, sizeof(CoordinatesOfSprinkler));
		cin >> N;
		for (int i = 0; i < N; i++) {
			cin >> CoordinatesOfSprinkler[i][0]>> CoordinatesOfSprinkler[i][1];
		}
		
		result = surviveMapDataByFrog(px, py, 0);
		if (result) {
			cout << "OK" << endl;
		}
		else {
			cout << "NA" << endl;
		}

	}

	return 0;
}
