#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2};
int dy[]={0, -1, -2, -2, -2, -1, 0, 1, 2, 2, 2, 1};

int main(){
    while(1){
        int sx, sy; cin>>sx>>sy;
        if(sx == 0 && sy == 0) return 0;

        vector<vector<int>> bo(10, vector<int>(10));
        int n; cin>>n;
        vector<int> x(n), y(n);
        for(int i=0; i<n; i++) cin>>x[i]>>y[i];

        queue<P> que;
        que.push(P(sy, sx));
        for(int i=0; i<n; i++){
            int queSize = (int)que.size();
            while(queSize--){
                int cy, cx;
                tie(cy, cx) = que.front();
                que.pop();

                for(int j=0; j<12; j++){
                    int ny = cy + dy[j];
                    int nx = cx + dx[j];

                    if(0 <= ny && ny < 10 && 0 <= nx && nx < 10){
                        if(abs(ny - y[i]) <= 1 && abs(nx - x[i]) <= 1){
                            que.push(P(ny, nx));
                        }
                    }
                }
            }
        }

        if(que.size()) cout << "OK" << endl;
        else cout << "NA" << endl;
    }
}
