#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define mp make_pair

using namespace std;

int dx[12] = {-1, 0, 1, 2, 2, 2, 1, 0,-1,-2,-2,-2};
int dy[12] = { 2, 2, 2, 1, 0,-1,-2,-2,-2,-1, 0,-1};
vector<pair<int,int> > v;
bool ans = false;

void dfs(int n,int i,int y,int x)
{
	if(i == n)
	{
		ans = true;
		return;
	}
	else
	{
		bool flag = true;
		int f[10][10];
		memset(f,0,sizeof(f));

		REP(k,-1,2)
		{
			REP(l,-1,2)
			{
				int py = v[i].first + k;
				int px = v[i].second + l;

				if(0 <= py && py < 10 && 0 <= px && px < 10)
				{
					f[py][px] = 1;
				}
			}
		}

		rep(j,12)
		{
			int nx = x + dx[j];
			int ny = y + dy[j];

			if(0 <= ny && ny < 10 && 0<= nx && nx < 10)
			{
				if(f[ny][nx] == 1)
				{
					flag = true;
					dfs(n,i+1,ny,nx);
				}
			}
			
		}
		if(flag) return;
	}
}

int main()
{
	
	while(true)
	{
		int x,y;
		cin >> x >> y;
		if(x == 0 && y == 0) break;

		v.clear();
		ans = false;
		
		int n,sp_x,sp_y;
		cin >> n;

		rep(i,n)
		{
			cin >> sp_x >> sp_y;
			v.pb(mp(sp_y,sp_x));
		}

		dfs(n,0,y,x);

		if(ans) cout << "OK" << endl;
		else cout << "NA" << endl;
	}
	return 0;
}