#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

bool check(int x, int y);
void jump(bool f[10][10], int x, int y);

int dx[12] = {2,2,2,1,0,-1,-2,-2,-2,-1,0,1};
int dy[12] = {1,0,-1,-2,-2,-2,-1,0,1,2,2,2};

int main() {
	while (true) {
		int px, py, n, x[10], y[10];
		
		cin >> px >> py;
		if (!px && !py) break;		
		cin >> n;
		REP(i, n) scanf("%d %d", &x[i], &y[i]);
		
		bool f[10][10];
		fill(f[0], f[10], false);
		f[py][px] = true;
		
		REP(i, n) jump(f, x[i], y[i]);
		
		bool ans = false;
		REP(i, 10) REP(j, 10) if (f[i][j]) ans = true;
		
		if (ans) puts("OK");
		else puts("NA");
	}
	return 0;
}

bool check(int x, int y) {
	return x >= 0 && x < 10 && y >= 0 && y < 10;
}

void jump(bool f[10][10], int x, int y) {
	bool tmp[10][10];
	fill(tmp[0], tmp[10], false);
	
	REP(i, 10) REP(j, 10) {
		if (!f[i][j]) continue;
		REP(k, 12) {
			int nx = j + dx[k], ny = i + dy[k];
			if (!check(nx, ny)) continue;
			tmp[ny][nx] = true;
		}
	}
	
	fill(f[0], f[10], false);
	REP(i, 10) REP(j, 10) {
		if (y - 1 <= i && i <= y + 1 && x - 1 <= j && j <= x + 1)
			f[i][j] = tmp[i][j];
	}
}