#include<iostream>
#include<vector>
#include<string>
using namespace std;

typedef pair<int, int> P;
void loop(int x, int y, int n, vector<P> spr);

string ans = "NA";

int main(){
    int firx, firy;
    while(cin >>firx >>firy){
        ans = "NA";
        if(firx == 0 && firy == 0) break;
        int n; cin >>n;
        vector<P> spr;
        for(int i = 0; i < n; i++){
            int tmpx, tmpy;
            cin >>tmpx >>tmpy;
            spr.push_back( make_pair(tmpx, tmpy) );
        }
        loop(firx, firy, 1, spr);
        cout <<ans <<endl;
    }
    return 0;
}

void loop(int x, int y, int n, vector<P> spr){
    int movex[] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2}, movey[] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1};
    int sprx[] = {0, -1, 0, 1, 1, 1, 0, -1, -1}, spry[] = {0, -1, -1, -1, 0, 1, 1, 1, 0};
    for(int i = 0; i < 12; i++){
        int nowx = x + movex[i], nowy = y + movey[i];
        if(n > 9) ans = "OK";
        else if(nowx > 9 || nowx < 0 || nowy > 9 || nowy < 0) ;
        else{
            for(int j = 0; j < spr.size(); j++){
                if(nowx == spr[n].first + sprx[j] && nowy == spr[n].second + spry[j]) loop(nowx, nowy, n + 1, spr);
            }
        }
    }
}