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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )
#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = (c).begin(); it != (c).end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define PB( n ) push_back( ( n ) )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define fst first
#define snd second

bool inside( pair<int,int> point )
{
	return 0 <= point.fst && point.fst < 10 && 0 <= point.snd && point.snd < 10;
}

const int jump[][2] = {
	-1,  2,
	 0,  2,
	 1,  2,
	 2,  1,
	 2,  0,
	 2, -1,
	 1, -2,
	 0, -2,
	-1, -2,
	-2, -1,
	-2,  0,
	-2, -1
};

int main()
{
	while ( true )
	{
		int x, y;
		cin >> x >> y;

		if ( x == 0 && y == 0 )
		{
			break;
		}

		int n;
		cin >> n;
		
		vector< pair<int,int> > s;

		REP( i, 0, n )
		{
			int x, y;
			cin >> x >> y;
			s.PB( MP( x, y ) );
		}

		set< pair<int,int> > current;
		current.insert( MP( x, y ) );

		REP( i, 0, n )
		{
			set< pair<int,int> > next;

			IREP( current, it )
			{				
				REP( j, 0, 12 )
				{
					pair<int,int> p = *it;

					p.fst += jump[j][0];
					p.snd += jump[j][1];

					if ( inside( p ) )
					{
						next.insert( p );
					}
				}
			}

			set< pair<int,int> > safety;

			for ( int dx = -1; dx <= 1; dx++ )
			{
				for ( int dy = -1; dy <= 1; dy++ )
				{
					pair<int,int> p = MP( s[i].fst, s[i].snd );

					p.fst += dx;
					p.snd += dy;

					if ( inside( p ) && next.find( p ) != next.end() )
					{
						safety.insert( p );
					}
				}
			}

			current = safety;
		}

		if ( 0 < current.size() )
		{
			cout << "OK";
		}
		else
		{
			cout << "NA";
		}
		cout << endl;
	}
	
	return 0;
}