#include <iostream>
#include <stack>
#include <cstring>

using P = std::pair<int, int>;
struct Data {
	P point;
	int num;
	Data() = default;
	Data(P _p, int _n) : point(_p), num(_n) {}
};

constexpr int MAX = 10;
int n;
bool board[MAX][MAX][MAX];
constexpr int initX[] = { 0, 0,-1,-1,-1,0,1,1,1 }, initY[] = { 0, -1,-1,0,1,1,1,0,-1 };
constexpr int dx[] = { 0,-1,-2,-2,-2,-1,0,1,2,2,2,1 }, dy[] = { -2,-2,-1,0,1,2,2,2,1,0,-1,-2 };

bool dfs(P s) {
	std::stack<Data> stk;
	stk.emplace(s, 0);
	int nx, ny;
	for (int i = 0; i < 12; ++i) {
		nx = s.first + dx[i];
		ny = s.second + dy[i];
		if (0 <= nx&&nx < 10 &&
			0 <= ny&&ny < 10)
			stk.emplace(P(nx, ny), 0);
	}
	while (!stk.empty()) {
		Data d = stk.top(); stk.pop();
		if (d.num == n) {
			if (board[0][d.point.second][d.point.first])
				return true;
			continue;
		}
		if (!board[d.num][d.point.second][d.point.first])
			continue;
		int nx, ny;
		for (int i = 0; i < 12; ++i) {
			nx = d.point.first + dx[i];
			ny = d.point.second + dy[i];
			if (0 <= nx&&nx < 10 &&
				0 <= ny&&ny < 10)
				stk.emplace(P(nx, ny), d.num + 1);
		}
	}
	return false;
}

int main() {
	P s;
	while (std::cin >> s.first >> s.second) {
		if (s.first + s.second == 0)
			break;
		std::memset(board, false, sizeof(board));
		std::cin >> n;
		int x, y, nx, ny;
		for (int i = 0; i < n; ++i) {
			std::cin >> x >> y;
			for (int j = 0; j < 9; ++j) {
				nx = x + initX[j];
				ny = y + initY[j];
				if (0 <= nx&&nx < 10 &&
					0 <= ny&&ny < 10)
					board[i][ny][nx] = true;
			}
		}
		bool ans = dfs(s);
		if (ans)
			std::cout << "OK" << std::endl;
		else
			std::cout << "NA" << std::endl;
	}

	return 0;
};