#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
bool check(const int x, const int y) {
	return (x >= 0 && x <= 9 && y >= 0 && y <= 9);
}

int ax[] = { -2,-2,-2,-1,0,1,2,2,2,1,0,-1 };
int ay[] = { -1,0,1,2,2,2,1,0,-1,-2,-2,-2 };

int main() {
	while (1) {
		int sx, sy; cin >> sx >> sy;
		if (!sx)break;
		sx--; sy--;
		if (!sx)break;
		int N; cin >> N;
		vector<vector<int>>oks(10, vector<int>(10, false));
		oks[sy][sx] = true;
		for (int i = 0; i < N; ++i) {
			int x, y; cin >> x >> y; x--; y--;

			vector<vector<int>>nextoks(10, vector<int>(10, false));
			vector<vector<int>>nextoks2(10, vector<int>(10, false));
			for (int dx = -1; dx <= 1; ++dx) {
				for (int dy = -1; dy <= 1; ++dy) {
					if (check(x + dx, y + dy)) {
						nextoks[y + dy][x + dx] = true;
					}
				}
			}
			for (int y = 0; y < 10; ++y) {
				for (int x = 0; x < 10; ++x) {
					if (oks[y][x]) {
						for (int t = 0; t < 12; ++t) {
							int nexty = y + ay[t];
							int nextx = x + ax[t];
							if (check(nextx, nexty)) {
								nextoks2[nexty][nextx] = true;
							}
						}
					}
				}
			}
			for (int y = 0; y < 10; ++y) {
				for (int x = 0; x < 10; ++x) {
					if (nextoks[y][x] && nextoks2[y][x])oks[y][x] = true;
					else oks[y][x] = false;
				}
			}
		}
		bool ok = false;
		for (int y = 0; y < 10; ++y) {
			for (int x = 0; x < 10; ++x) {
				if (oks[y][x])ok = true;
			}
		}
		if (ok) {
			cout << "OK" << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}
	
	return 0;
}