#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int n;
int x[100], y[100];
int dx[]{ 2,2,2,-2,-2,-2,1,0,-1,1,0,-1 }, dy[]{ 1,0,-1,1,0,-1,2,2,2,-2,-2,-2 };
bool dfs(int cnt, int px, int py) {
	if (~cnt && (abs(x[cnt] - px) > 1 || abs(y[cnt] - py) > 1))return false;
	if (cnt == n - 1)return true;
	rep(i, 12) {
		int nx = px + dx[i], ny = py + dy[i];
		if (0 <= nx&&nx < 10 && 0 <= ny&&ny < 10 && dfs(cnt + 1, nx, ny) == true)
			return true;
	}
	return false;
}
int main() {
	int px, py;
	while (scanf("%d%d", &px, &py), px) {
		scanf("%d", &n);
		rep(i, n) {
			scanf("%d%d", &x[i], &y[i]);
		}
		puts(dfs(-1, px, py) ? "OK" : "NA");
	}
}