#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>

using namespace std;

typedef complex<double> xy_t;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF= 1 << 30;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;

#define rep(i, n) for(int i = 0; i < n; i++)
int dy[] = {2, 2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1};
int dx[] = {1, 0, -1, -2, -2, -2, -1, 0, 1, 2, 2, 2};

bool memo[10][10][10]; // ツ暗環置ツづ篠淞づ可行ツつゥツづ按つュツづづ債つ「ツつッツづ按つ「ツスツプツδ環δ督クツδ可ー
P sp[10];

int main(){
	int n;
	int sx, sy;
	bool f;
	while(cin >> sx >> sy && (sx || sy)){
		memset(memo,false, sizeof(memo));
		cin >> n;
		rep(i, n) cin >> sp[i].first >> sp[i].second;

		f = false;
		memo[sx][sy][0] = true;
		queue<PP> que;
		que.push(PP(0, P(sx, sy)));
		while(!que.empty()){
			PP pp = que.front();
			que.pop();
			int next = pp.first;
			int n2 = (next + 1) % n;
			int x = pp.second.first;
			int y = pp.second.second;
			if(memo[x][y][n2]) continue;
			memo[x][y][n2] = true;
			for(int i = 0; i < 12; i++){
				int x2 = x + dx[i];
				int y2 = y + dy[i];
				if(0 <= x2 && x2 < 10 && 0 <= y2 && y2 < 10){
					bool ok = false;
					for(int j = -1; j <= 1; j++){
						for(int k = -1; k <= 1; k++){
							if(sp[next].first + j == x2 && sp[next].second + k == y2) ok = true;
						}
					}
					if(!ok) continue;

					if(memo[x2][y2][n2]){
			//			cout << x2 << " " << y2 << " " << n2 << endl;
						f = true;
					}else{
						que.push(PP(n2, P(x2, y2)));
					//	cout << x2 << " " << y2 << " " << n2 << endl;
					}
				}
			}
		}
		if(!f) cout << "NA" << endl;
		else cout << "OK" << endl;
	}
	return 0;
}