#include <iostream>
#include <queue>
#include <set>
#include <utility>
using namespace std;

#define fi first
#define se second

#define mkp(x, y) (make_pair(x, y))

int main() {
	pair<int,int> primary;
	int n;
	pair<int,int> move[] = {
		mkp(-1, -2), mkp(0, -2), mkp(1, -2),
		mkp(-2, -1), mkp(-2, 0), mkp(-2, 1),
		mkp(2, -1), mkp(2, 0), mkp(2, 1),
		mkp(-1, 2), mkp(0, 2), mkp(1, 2), };

	while(cin >> primary.fi >> primary.se, primary.fi || primary.se) {
		cin >> n;
		queue<pair<int,int> > que;
		que.push(mkp(primary.fi, primary.se));

		for(int i = 0; i < n; i++) {
			pair<int,int> pivot;
			set<pair<int, int> > visited;
			queue<pair<int,int> > next_que;

			cin >> pivot.fi >> pivot.se;

			while(!que.empty()) {
				pair<int,int> pos;
				pos = que.front(); que.pop();

				for(int j = 0; j < sizeof(move) / sizeof(move[0]); j++) {
					int x, y;
					x = pos.fi + move[j].fi;
					y = pos.se + move[j].se;
					if((0 <= x && x <= 9) && (0 <= y && y <= 9)) {
						if((pivot.fi - 1 <= x && x <= pivot.fi + 1) && (pivot.se - 1 <= y && y <= pivot.se + 1)) {
							if(visited.find(mkp(x,y)) == visited.end()) {
								next_que.push(mkp(x,y));
							}
							visited.insert(mkp(x,y));
						}
					}
				}
			}

			que = next_que;
		}

		if(!que.empty()) {
			cout << "OK" << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}

	return 0;
}