#include <iostream>
#include <algorithm>
using namespace std;

const int pdx[12] = { -2, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 2 };
const int pdy[12] = { -1, 0, 1, -2, 2, -2, 2, -2, 2, -1, 0, 1 };
const int sdx[9] = { 0, 0, 0, 1, 1, 1, -1, -1, -1 };
const int sdy[9] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
bool memo[10][10][10];
int sx[10];
int sy[10];
int n;
bool flag;


void init()
{
	flag = false;
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			for (int k = 0; k < 10; k++)
			{
				memo[i][j][k] = false;
			}
		}
	}
}

bool isSafePos(int x, int y, int t)
{
	for (int i = 0; i < 9; i++)
	{
		if (x == sx[t] + sdx[i] && y == sy[t] + sdy[i]) return true;
	}
	return false;
}

bool check(int x, int y, int t)
{
	if (x < 0 || 9 < x || y < 0 || 9 < y) return false;
	if (memo[x][y][t]) return false;
	if (!(isSafePos(x, y, t))) return false;
	return true;
}


void calc(int x, int y, int t)
{
	memo[x][y][t] = true;
	if (t == n)
	{
		flag = true;
		return;
	}
	for (int i = 0; i < 12; i++)
	{
		int X = x + pdx[i];
		int Y = y + pdy[i];
		if (check(X, Y, t % n))	calc(X, Y, t + 1);
	}
}


int main()
{
	int px, py;
	while (cin >> px >> py, px + py)
	{
		cin >> n;
		for (int i = 0; i < n; i++) cin >> sx[i] >> sy[i];
		init();
		calc(px, py, 0);
		if (flag) cout << "OK" << endl;
		else cout << "NA" << endl;
	}

	return 0;
}