#include <iostream>
#include <utility>
using namespace std;

int pdx[12] = {2,2,2,1,0,-1,-2,-2,-2,-1,0,1};
int pdy[12] = {-1,0,1,2,2,2,1,0,-1,-2,-2,-2};
int sdx[9] = {0,1,0,-1,0,1,1,-1,-1};
int sdy[9] = {0,0,1,0,-1,-1,1,1,-1};
int N;
pair<int,int> sp[10];

bool dfs(int x, int y, int d) {
	if (d == N) return true;
	for (int i=0; i<12; i++) {
		int px=x+pdx[i], py=y+pdy[i];
		if (px<0||py<0||px>9||py>9) continue;
		for (int j=0; j<9; j++) {
			int sx=sp[d].first+sdx[j], sy=sp[d].second+sdy[j];
			if (sx<0||sy<0||sx>9||sy>9) continue;
			if (px==sx&&py==sy)
				if (dfs(px,py,d+1)) return true;
		}
	}
	return false;
}

int main() {
	int x, y;
	while (cin >> x >> y, x||y) {
		cin >> N;
		for (int i=0; i<N; i++) {
			int a, b;
			cin >> a >> b;
			sp[i] = make_pair(a,b);
		}

		cout << (dfs(x,y,0) ? "OK" : "NA") << endl;
	}
	return 0;
}