#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


typedef pair <int, II> NODE;
typedef queue <NODE> QUEUE;

const int DSIZE = 12;
const int dr[DSIZE] = { 2, 2, 2, -2, -2, -2, 1, 0, -1, 1, 0, -1 };
const int dc[DSIZE] = { 1, 0, -1, 1, 0, -1, 2, 2, 2, -2, -2, -2 };
const string YES = "OK";
const string NO = "NA";

int sr, sc;
int n;
const int SIZE = 11;
int R[SIZE], C[SIZE];
bool V[10][10][11];

bool isValidPos( int r1, int c1, int r2, int c2 ) {
    for ( int i = -1; i < 2; ++ i ) {
        for ( int j = -1; j < 2; ++ j ) {
            int nr = r2 + i;
            int nc = c2 + j;
            if ( nr < 0 || nr >= 10 ) continue;
            if ( nc < 0 || nc >= 10 ) continue;
            if ( nr == r1 && nc == c1 ) return true;
        }
    }
    return false;
}

string solve() {
    fill( (bool*)V, (bool*)V + 10*10*10, false );
    QUEUE Q;
    Q.push( NODE( 0, II( sr, sc ) ) );
    V[sr][sc][0] = true;
    while ( ! Q.empty() ) {
        NODE node = Q.front();
        Q.pop();
        int step = node.first;
        int r = node.second.first;
        int c = node.second.second;

        if ( step == 10 && isValidPos( r, c, R[9], C[9] ) ) {
            return YES;
        }
        
        for ( int i = 0; i < DSIZE; ++ i ) {
            int nr = r + dr[i];
            int nc = c + dc[i];
            int nstep = step + 1;
            if ( nr < 0 || nr >= 10 ) continue;
            if ( nc < 0 || nc >= 10 ) continue;
            if ( ! isValidPos( nr, nc, R[step], C[step] ) ) continue;
            NODE next( nstep, II( nr, nc ) );
            Q.push( next );
        }
    }
    return NO;
}

int main() {
    while ( cin >> sc >> sr ) {
        if ( sr == 0 && sc == 0 ) break;
        cin >> n;
        for ( int i = 0; i < n; ++ i ) {
            cin >> C[i] >> R[i];
        }
        cout << solve() << endl;
    }
    return 0;
}