#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)

bool can[2][10][10];
int x,y,n,sx,sy,dx1[]={2,2,2,1,1,0,0,-1,-1,-2,-2,-2},dy1[]={1,0,-1,2,-2,2,-2,2,-2,1,0,-1},dx2[]={1,1,1,0,0,0,-1,-1,-1},dy2[]={1,0,-1,1,0,-1,1,0,-1};

int main(){
	while(cin>>x>>y&&(x+y)){
		rep(i,10){fill(can[0][i],can[0][i]+10,0);fill(can[1][i],can[1][i]+10,0);}
		can[0][x][y]=1;
		cin>>n;
		rep(i,n){
			cin>>sx>>sy;
			rep(j,10)rep(k,10)if(can[0][j][k])rep(l,12)rep(m,9)if(j+dx1[l]>=0&&j+dx1[l]<=9&&j+dx1[l]==sx+dx2[m]&&k+dy1[l]>=0&&k+dy1[l]<=9&&k+dy1[l]==sy+dy2[m])can[1][j+dx1[l]][k+dy1[l]]=1;
			rep(j,10)rep(k,10){can[0][j][k]=can[1][j][k];}
			rep(j,10)fill(can[1][j],can[1][j]+10,0);
		}
		bool ans=0;
		rep(i,10)rep(j,10)if(can[0][i][j])ans=1;
		cout<<(ans?"OK":"NA")<<endl;
	}
}