#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007
 
int dx[12] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2};
int dy[12] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1};
int ddx[9] = {-1, 0, 1, 1, 1, 0, -1, -1, 0};
int ddy[9] = {-1, -1, -1, 0, 1, 1, 1, 0, 0};
bool f;
int n;
vector<vi> v;


void dfs(int x, int y, vi u,int size){
	if(size == n || f) {
		f = true;
		return;
	}
	rep(i,12){
		int nx = x + dx[i], ny = y + dy[i];
		if (nx >= 0 && ny >= 0 && nx < 10 && ny < 10){
			rep(j, 9){
				int nnx = nx + ddx[j], nny = ny + ddy[j];
				if (nnx >= 0 && nny >= 0 && nnx < 10 && nny < 10){
					if(v[nnx][nny] && !u[v[nnx][nny]]){
						u[v[nnx][nny]] = 1;
						dfs(nx, ny, u, size + 1);
						u[v[nx][ny]] = 0;
					}
				}
			}
		}
	}
}


int main(){
	int sx, sy;
	int x, y;
	while(cin>>sx>>sy){
		if(sx==0 && sy == 0) break;
		cin>>n;
		v = vector<vi>(10,vi(10,0));
		f = false;
		rep(i, n) cin>>x>>y, v[x][y] = i + 1;
		vi u(n + 1, 0);
		dfs(sx, sy, u, 0);
		cout<<(f?"OK":"NA")<<endl;
	}
}