#include<cstdio>
#include<cstdlib>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int dx[]={-2,-2,-2,-1,0,1,-1,0,1,2,2,2};
int dy[]={-1,0,1,2,2,2,-2,-2,-2,-1,0,1};
typedef pair<int,int>P;
int F(P l,P r)
{
	if(l.first<0||l.second<0||l.first>=10||l.second>=10)return 0;
	return abs(l.first-r.first)<=1&&abs(l.second-r.second)<=1;
}
int main()
{
	int x,y,n,i,j,k,s;
	P p[10];
	while(scanf("%d%d",&x,&y),x&&y)
	{
		scanf("%d",&n);
		for(i=0;i<n;++i)scanf("%d%d",&p[i].first,&p[i].second);
		vector<P>v[2];
		v[0].push_back(P(x,y));
		for(s=i=0;i<n;++i)
		{
			sort(v[s].begin(),v[s].end());
			v[s].erase(unique(v[s].begin(),v[s].end()),v[s].end());
			v[!s].clear();
			for(j=0;j<v[s].size();++j)
			{
				for(k=0;k<12;++k)
				{
					P q(v[s][j].first+dx[k],v[s][j].second+dy[k]);
					if(F(q,p[i]))v[!s].push_back(q);
				}
			}
			s=!s;
		}
		puts(v[s].size()?"OK":"NA");
	}
	return 0;
}