#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

class Point {
public:
	int x;
	int y;

	Point() {
		x = y = 0;
	}
	Point(int x, int y) {
		this->x = x; this->y = y;
	}

	friend std::ostream& operator << (std::ostream& ostr, const Point& p) {
		std::cout << "{" << p.x << ", " << p.y << "}";
		return ostr;
	}
};

bool field[10][10];
int dx[12] = { -1, 0, 1, -2, 2, -2, 2, -2, 2, -1, 0, 1};
int dy[12] = { -2, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 2 };

void init() {
	REP(y, 10) {
		REP(x, 10) {
			field[y][x] = false;
		}
	}
}

void print() {
	REP(y, 10) {
		REP(x, 10) {
			cout << (field[y][x] ? "???" : "???") << " ";
		}
		cout << endl;
	}
	cout << endl;
}

//p ???????????£????????§???????????????1???
void reach(Point p) {
	int x, y;
	x = p.x; y = p.y;

	REP(i, 12) {
		int nx, ny;
		nx = x + dx[i];
		ny = y + dy[i];
		if (nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
		field[ny][nx] = true;
	}
}

//?????????????????????????±????????????\??????0???
void range(Point s)
{
	int sx, sy;
	sx = s.x; sy = s.y;

	REP(y, 10) {
		REP(x, 10) {
			if (x < sx - 1 || x > sx + 1 || y < sy - 1 || y > sy + 1) {
				field[y][x] = false;
			}
		}
	}
}

//?????????????????? (??´????????§?¨???????, ???????????????????????§?¨?)
vector<Point> habitable(vector<Point> p, Point s)
{
	vector<Point> np;
	init();

	REP(i, p.size()) {
		reach(p[i]);
	}

	range(s);
	
	REP(y, 10) {
		REP(x, 10) {
			if (field[y][x]) {
				np.push_back(Point(x, y));
			}
		}
	}

	return np;
}

bool AOJ0122()
{
	Point p;
	int n;

	cin >> p.x >> p.y;
	if (p.x + p.y == 0) return false;

	cin >> n;

	Point s[10];

	REP(i, n) {
		cin >> s[i].x >> s[i].y;
	}

	vector<Point> h;
	h.push_back(Point(p.x, p.y));

	REP(i, n) {
		h = habitable(h, s[i]);
		if (h.size() == 0) {
			cout << "NA" << endl;
			return true;
		}
	}
	cout << "OK" << endl;
	return true;
}

int main()
{

	while (AOJ0122()) {

	}

	return 0;
}