#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>

using namespace std;

typedef pair<int, int> P;
typedef pair<P, int> P2; //3d array

const int dx[] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2}; //direction column
const int dy[] = {2, 2, 2, 1, 0, -1, -2, -2, -2, 1, 0, -1}; // direction row

int sx, sy, n;

bool Solution(vector<P> sprinkler)
{
    queue<P2> que;
    que.push(P2(P(sx, sy), 0));
    
    while(!que.empty())
    {
        int x = que.front().first.first;
        int y = que.front().first.second;
        int c = que.front().second;
        
        que.pop();
        
        if(c == n)
        {
            return true;
        }
        
        for(int i = 0 ; i < 12 ; i++)
        {
            int nx = x + dx[i];
            int ny = y + dy[i];
            
            if(0 <= nx && nx <= 9 && 0 <= ny && ny <= 9 &&
               abs(nx - sprinkler[c].first) <= 1 && abs(ny - sprinkler[c].second) <= 1)
            {
                que.push(P2(P(nx, ny), c + 1));
            }
        }
    }
    return false;
}

int main()
{
    while(cin>>sx>>sy, sx&&sy)
    {
        cin>>n;
        
        vector<P> sprinkler(n);  //notice P is pair<int, int>
        
        for(int i = 0 ; i < n ; i++)
        {
            cin>>sprinkler[i].first>>sprinkler[i].second;
        }
        
        if(Solution(sprinkler))
        {
            cout << "OK" << endl;
        }
        else
        {
            cout << "NA" << endl;
        }
    }
    
    return 0;
}