#include<iostream>
#define MAX_SPR 11
#define MAP_SIZE 10
using namespace std;

//}bvTõ
void search_map(int sprx[], int spry[], int pyonx, int pyony, int sprnum, int lastsprnum);

//okflag = search_mapÅgp·éA¶¶©±©çÑé©Ì»ètO
//endflag = XvN[ðêüµ½©Ì»ètO
bool okflag = false, endflag = false;

int main(){
	
	//firstpyonx = ÒåñgNÌúÊuÌ¡ÀW, firstpyony = ÒåñgNÌúÊuÌcÀW,
	int firstpyonx, firstpyony;
	
	while(cin >>firstpyonx >>firstpyony){
		if(firstpyonx == 0 && firstpyony == 0) break;
		okflag = false;
		endflag = false;
		
		//n = XvN[Ì
		//sprx[XvN[ÌÔ] = »ÌÔÌXvN[Ì¡ÀW, spry[XvN[ÌÔ] = »ÌÔÌXvN[ÌcÀW
		int n, sprx[MAX_SPR], spry[MAX_SPR];
		
		cin >>n;
		
		//XvN[ÌÊuîñüÍ
		for(int i = 0; i < n; i++){
			int x, y;
			cin >>x >>y;
			sprx[i] = x;
			spry[i] = y;
		}
		search_map(sprx, spry, firstpyonx, firstpyony, 0, (n - 1));
		
		//}bvTõÌÊðoÍ
		if(okflag == true){
			cout <<"OK" <<endl;
		} else{
			cout <<"NA" <<endl;
		}
	}
	return 0;
}

void search_map(int sprx[], int spry[], int pyonx, int pyony, int sprnum, int lastsprnum){
	
	//map[][] = }bvîñ(·×Ä0Åú»AÄAÌÛÉn·KvÍÈ¢)
	//movepyonx[] = ÒåñgNÌ®­¡ÀWîñ, movepyony[] = ÒåñgNÌ®­cÀWîñ
	//movesprx[] = XvN[ªLøÆÈé¡ÀWîñ, movespry[] = XvN[ªLøÆÈécÀWîñ
	int map[MAP_SIZE][MAP_SIZE] = {0};
	int movepyonx[12] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2};
	int movepyony[12] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1};
	int movesprx[9] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
	int movespry[9] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
	
	//ÅãÌXvN[ÉBµ½ê
	if(sprnum > lastsprnum){
		endflag = true;
		search_map(sprx, spry, pyonx, pyony, 0, lastsprnum);
	
	//TõrÌê(êüµÄßÁÄ«½êàÜÞ)
	} else{
		
		//Òåñg­ñÌs¯éêÌ}bvîñð+1É·é
		for(int i = 0; i < 12; i++){
			
			//}bvðÍÝo³È¢©»è
			if(pyonx + movepyonx[i] < 0 || pyony + movepyony[i] < 0 || pyonx + movepyonx[i] > 9 || pyony + movepyony[i] > 9){
				continue;
			}
			
			map[pyony + movepyony[i]][pyonx + movepyonx[i]]++;
		}
		
		//XvN[ÌLøÈêÌÀWð+2É·é
		for(int k = 0; k < 9; k++){
			
			//}bvðÍÝo³È¢©»è
			if(sprx[sprnum] + movesprx[k] < 0 || spry[sprnum] + movespry[k] < 0 || sprx[sprnum] + movesprx[k] > 9 || spry[sprnum] + movespry[k] > 9){
				continue;
			}
			
			map[spry[sprnum] + movespry[k]][sprx[sprnum] + movesprx[k]] += 2;
		}
		
		//}bvÅ3ÆÈÁ½ÊuðÒåñg­ñÌÊuÆµÄÄA
		for(int y = 0; y < MAP_SIZE; y++){
			for(int x = 0; x < MAP_SIZE; x++){
				if(map[y][x] >= 3){
					
					//endflag = trueÌêÅ3ªo½êÍ¶¶·é½ßAokflagð§ÄÄTõEo
					if(endflag == true){
						okflag = true;
						break;
					}
					else{
						search_map(sprx, spry, x, y, (sprnum + 1), lastsprnum);
					}
				}
			}
			if(okflag == true) break;
		}
	}
}