#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#define P pair<int,int>
using namespace std;

int x[12] = { -2,-2,-2,-1,-1,0,0,1,1,2,2,2 }, y[12] = { -1,0,1,-2,2 ,- 2,2,-2,2,-1,0,1 };
int main()
{
	map<P, bool>U;
	for (int i = 0; i < 12; i++) {
		U[P(x[i], y[i])] = true;
	}
	int a, b;
	while (cin >> a >> b, a | b) {
	      map<int, set<P>>S;
		  S[0].insert(P(a, b));
		  int c; cin >> c;
		  for (int i = 1; i <= c; i++) {
			  int d, e; cin >> d >> e;
			  for (auto k = S[i - 1].begin(); k != S[i - 1].end(); k++) {
				  for (int j = -1; j < 2; j++) {
					  for (int l = -1; l < 2; l++) {
						  if (d + j >= 0 && d + j < 10 && e + l >= 0 && e + l < 10 && U[P(d + j - k->first, e + l - k->second)]) {
							  S[i].insert(P(d + j, e + l));
						  }
					  }
				  }
			  }
		  }
		  if (S[c].size())puts("OK");
		  else puts("NA");
	}
}