#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;


int main()
{
	int startX, startY;
	while (scanf("%d %d", &startX ,&startY), startX | startY)
	{
		int n;
		scanf("%d", &n);
		int sx[126];
		int sy[126];
		for (int i = 0; i < n; ++i)
		{
			int a, b;
			scanf("%d %d", &a, &b);
			sx[i] = a;
			sy[i] = b;
		}

		bool alive = true;
		bool schrodinger[16][16];
		memset(schrodinger, 0, sizeof(schrodinger));
		schrodinger[startY][startX] = true;
		for (int i = 0; alive && i < n; ++i)
		{
			bool next[16][16];
			memset(next, 0, sizeof(next));
			for (int y = 0; y < 10; ++y)
			{
				for (int x = 0; x < 10; ++x)
				{
					if (!schrodinger[y][x])
						continue;

					int d[] = { -2, 2 };
					for (int j = 0; j < 2; ++j)
					{
						for (int k = -1; k <= 1; ++k)
						{
							int ya = y + d[j];
							int xa = x + k;
							int yb = y + k;
							int xb = x + d[j];
#define in(pos) (0 <= pos && pos < 10)
							if (in(ya) && in(xa))
								next[y+d[j]][x+k] = true;
							if (in(yb) && in(xb))
								next[y+k][x+d[j]] = true;
						}
					}
				}
			}

			alive = false;
			memset(schrodinger, 0, sizeof(schrodinger));
			for (int j = -1; j <= 1; ++j)
			{
				for (int k = -1; k <= 1; ++k)
				{
					int ty = sy[i] + j;
					int tx = sx[i] + k;
					if (in(ty) && in(tx) && next[ty][tx])
					{
						schrodinger[ty][tx] = true;
						alive = true;
					}
				}
			}
		}

		puts(alive ? "OK" : "NA");
	}

	return 0;
}