#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e15+9
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

bool f;
ll n, x, y;
P start;
vector<P> vp;
P Move[12] = { P(-2, 1), P(-2, 0), P(-2, -1), P(-1, 2), P(-1, -2),
P(0, 2), P(0, -2), P(1, 2), P(1, -2), P(2, 1), P(2, 0), P(2, -1) };

void solve(ll num, ll x, ll y){
	if (num == n){
		f = 1;
		return;
	}
	REP(i, 12){
		ll nx = x + Move[i].first, ny = y + Move[i].second;
		if (nx >= 0 && nx <= 9 && ny >= 0 && ny <= 9){
			int posx = vp[num].first, posy = vp[num].second;
			if (posx - 1 <= nx&&nx <= posx + 1 && posy - 1 <= ny&&ny <= posy + 1){
				solve(num + 1, nx, ny);
			}
		}
	}
}

int main(){
	while (cin >> x >> y&&x + y){
		f = 0;
		start = P(x, y);
		vp.clear();
		cin >> n;
		REP(i, n){
			cin >> x >> y;
			vp.push_back(P(x, y));
		}
		solve(0, start.first, start.second);
		if (f)cout << "OK" << endl;
		else cout << "NA" << endl;
	}
}