#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int main() {
	int i,j,k,g,f,n,px,py,sx[11],sy[11],d[11][3][3];
	int dx[12]={-1,0,1,2,2,2,1,0,-1,-2,-2,-2},dy[12]={-2,-2,-2,-1,0,1,2,2,2,1,0,-1};
	while(cin >> sx[0] >> sy[0]) {
		if (sx[0]+sy[0]==0) break;
		memset(d,0,sizeof(d));
		cin >> n;
		for (i=1;i<=n;i++) cin >> sx[i] >> sy[i];
        d[0][1][1]=1;
		for (i=0;i<n;i++) {
			f=0;
			for (k=-1;k<2;k++) for (g=-1;g<2;g++) {
                if (d[i][1+k][1+g]==0) continue;
			    for (j=0;j<12;j++) {
				    px=g+sx[i]+dx[j]; py=k+sy[i]+dy[j];
				    if (px<0 || px>9 || py<0 || py>9) continue;
				    if ((sx[i+1]-px)*(sx[i+1]-px)<2 && (sy[i+1]-py)*(sy[i+1]-py)<2) { f=1; d[i+1][py-sy[i+1]+1][px-sx[i+1]+1]=1;}
           		}
			}
            if (f==0) break;
		}
        if (f==1) cout << "OK" << endl; else cout << "NA" << endl;
	}
	return 0;
}