import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;
int[] dx = [-2,-2,-2,-1,-1,0,0,1,1,2,2,2];
int[] dy = [1,0,-1,2,-2,2,-2,2,-2,1,0,-1];
int[] spx,spy;
int tl;

bool saiki(int x,int y,int n){
    if(tl==n) return true;
    bool ans = false;
    for(int i=0;i<12;i++){
	int nx,ny;
	nx = x + dx[i];
	ny = y + dy[i];
	if(0<=nx&&nx<=9&&0<=ny&&ny<=9){
	    if(abs(nx-spx[n])<=1 && abs(ny-spy[n])<=1){
		ans = ans || saiki(nx,ny,n+1);
	    }
	}
    }
    return ans;
}

void main(){
    while(true){
	int x,y;
	auto s = readln().split().to!(int[]);
	x = s[0];
	y = s[1];
	if(x==0&&y==0) break;
	spx = new int[10];
	spy = new int[10];
	int n = readln().chomp().to!int;
	tl = n;
	auto s1 = readln().split().to!(int[]);
	for(int i=0;i<n;i++){
	    spx[i] = s1[2*i];
	    spy[i] = s1[2*i+1]; 
	}
	writeln(saiki(x,y,0) ? "OK" : "NA");
    }
}