#include <iostream>

using namespace std;

int sx, sy;
int n;
int px[11], py[11];

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

int wx[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int wy[] = {1, 1, 1, 0, 0, 0, -1, -1, -1};

bool dfs(int x, int y, int t) {
    if (t == n) {
        return true;
    }
    bool ret = false;
    for (int i = 0; i < 12; ++i) {
        int nextx = x + dx[i];
        int nexty = y + dy[i];
        if (nextx < 0 || 9 < nextx || nexty < 0 || 9 < nexty) {
            continue;
        }
        bool hasWater = false;
        for (int j = 0; j < 9; ++j) {
            int tmpx = px[t] + wx[j];
            int tmpy = py[t] + wy[j];
            if (nextx == tmpx && nexty == tmpy) {
                hasWater = true;
                break;
            }
        }
        if (!hasWater) {
            continue;
        }
        ret += dfs(nextx, nexty, t + 1);
    }
    return ret;
}

int main() {
    while (true) {
        cin >> sx >> sy;
        if (sx == 0 && sy == 0) {
            return 0;
        }
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> px[i] >> py[i];
        }

        if (dfs(sx, sy, 0)) {
            cout << "OK" << endl;
        } else {
            cout << "NA" << endl;
        }
    }
}