#include <cstring>
#include <iostream>
#define p(c) (0 <= c && c < 10)
using namespace std;
int n, sx, sy, tx, ty; bool ok[11][10][10];
int main() {
	while (cin >> sx >> sy, sx + sy) {
		cin >> n; memset(ok, false, sizeof(ok));
		ok[0][sy][sx] = true;
		for (int i = 1; i <= n; i++) {
			cin >> tx >> ty;
			for (int j = 0; j < 1000; j++) {
				int x = j % 10, y = j / 10;
				if (!ok[i - 1][y][x]) continue;
				for (int l = -2; l <= 2; l++) {
					for (int m = -2; m <= 2; m++) {
						if (p(y + l) && p(x + m) && abs(ty - y - l) < 2 && abs(tx - x - m) < 2 && (abs(l) == 2 || abs(m) == 2) && abs(l * m) != 4) ok[i][y + l][x + m] = 1;
					}
				}
			}
		}
		int ret = 0;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				if (ok[n][i][j]) ret = 1;
			}
		}
		cout << (ret ? "OK" : "NA") << endl;
	}
}