#include <iostream>
#include <queue>

using namespace std;

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

class state {

public:
    int x;
    int y;
    int cnt;
    state(int a, int b, int c) { x = a; y = b; cnt = c; }
};

int main()
{
    int px, py;

    while (cin >> px >> py, px || py) {
        int n;
        vector<int> map[10][10];

        cin >> n;
        for (int i = 0; i < n; i++) {
            int sx, sy;

            cin >> sx >> sy;
            for (int y = -1; y <= 1; y++)
                for (int x = -1; x <= 1; x++) {
                    if (sx + x < 0 || sx + x > 9 || sy + y < 0 || sy + y > 9)
                        continue;
                    map[sy + y][sx + x].push_back(i + 1);
                }
        }
        
        state s(px, py, 1);
        queue<state> q;
        bool flag = false;

        q.push(s);
        
        while (!q.empty()) {
            state now = q.front();
            q.pop();

            if (now.cnt == 11) {
                flag = true;
                break;
            }
            
            for (int i = 0; i < 12; i++) {
                int nx = dx[i] + now.x;
                int ny = dy[i] + now.y;

                if (nx < 0 || nx > 9 || ny < 0 || ny > 9)
                    continue;
                for (int k = 0; k < map[ny][nx].size(); k++) {
                    if (map[ny][nx][k] == now.cnt) {
                        state in(nx, ny, now.cnt + 1);
                        q.push(in);
                    }
                }
            }
        }

        if (flag) 
            cout << "OK\n";
        else
            cout << "NA\n";
    }

    return 0;
}