#include <cstring>
#include <iostream>
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++) {
				if (!ok[i - 1][j / 10][j % 10]) continue;
				for (int l = -2; l <= 2; l++) {
					for (int m = -2; m <= 2; m++) {
						if (0 <= j / 10 + l && j / 10 + l < 10 && 0 <= j % 10 + m && j % 10 + m < 10) {
							if (abs(ty - j / 10 - l) <= 1 && abs(tx - j % 10 - m) <= 1 && (abs(l) == 2 || abs(m) == 2) && abs(l * m) != 4) ok[i][j / 10 + l][j % 10 + m] = true;
						}
					}
				}
			}
		}
		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;
	}
}