#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <complex>
#include <sstream>
#include <stack>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

int main()
{
	int y, x;
	while(scanf("%d%d", &x, &y), x||y){
		vector<vector<bool> > able(10, vector<bool>(10, false));
		able[y][x] = true;
		
		int n;
		scanf("%d", &n);
		
		pii sprinkler;
		bool exists;
		rep(i, n){
			scanf("%d%d", &sprinkler.second, &sprinkler.first);
			vector<vector<bool> > tmp(10, vector<bool>(10, false));
			exists = false;
			rep(j, 10) rep(k, 10){
				if(!able[j][k])
					continue;

				const int dy[] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1};
				const int dx[] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2};
				rep(l, 12){
					int py = j + dy[l];
					int px = k + dx[l];
					if(py<0 || 10<=py || px<0 || 10<=px)
						continue;
					if(abs(py-sprinkler.first) <= 1 &&  abs(px-sprinkler.second) <= 1){
						tmp[py][px] = true;
						exists = true;
					}
				}
			}
			able = tmp;
		}
		
		puts(exists ? "OK" : "NA");
	}

	return 0;
}