#include <cstring>
#include <iostream>
using namespace std;
const int rx[] = {0, 1, 1, 0, -1, -1, -1, 0, 1};
const int ry[] = {0, 0, 1, 1, 1, 0, -1, -1, -1};
const int dx[] = {2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2};
const int dy[] = {0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2, -1};
int n;
int x, y;
int sx[10];
int sy[10];
bool field[11][10][10];

void printfiled(int c) {
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			cout << field[c][j][i];
		}
		cout << endl;
	}
	cout << endl;
}

bool exists(int current, int na, int nb) {
	for (int i = 0; i < 12; i++) {
		const int a = na - dx[i];
		const int b = nb - dy[i];
		if (0 <= a && a < 10 && 0 <= b && b < 10) {
			if (field[current][a][b]) return true;
		}
	}
	return false;
}

bool solve() {
	field[0][x][y] = true;
	for (int i = 0; i < n; i++) {
		const int current = i;
		const int next = current + 1;
		bool alive = false;
		for (int j = 0; j < 9; j++) {
			const int na = sx[i] + rx[j];
			const int nb = sy[i] + ry[j];
			if (0 <= na && na < 10 && 0 <= nb && nb < 10) {
				field[next][na][nb] = exists(current, na, nb);
				alive = alive || field[next][na][nb];
			}
		}
		if (!alive) return false;
//		printfiled(i);
	}
	return true;
}

int main () {
	while (cin >> x >> y, x || y) {
		memset(field, 0, sizeof(field));
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> sx[i] >> sy[i];
		}
		cout << (solve() ? "OK":"NA") << endl;
	}
	return 0;
}