#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int a, b;
    while(cin >> a >> b, a){
        int n;
        cin >> n;
        vector<int> xs{a}, ys{b};
        for (int i = 0; i < n; ++i) {
            int x, y;
            cin >> x >> y;
            ys.emplace_back(y); xs.emplace_back(x);
        }
        array<int, 9> dy{-1, -1, -1, 0, 0, 0, 1, 1, 1}, dx{-1, 0, 1, -1, 0, 1, -1, 0, 1};
        vector<array<int, 9>> dp(xs.size());
        dp[0][4] = 1;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < 9; ++j) {
                if(!dp[i][j]) continue;
                int y = ys[i]+dy[j], x = xs[i]+dx[j];
                for (int k = 0; k < 9; ++k) {
                    int yy = ys[i+1]+dy[k], xx = xs[i+1]+dx[k];
                    if(0 <= yy && yy <= 9 && 0 <= xx && xx <= 9
                    && max(abs(x-xx), abs(y-yy)) == 2 && abs(x-xx)+abs(y-yy) != 4){
                        dp[i+1][k] = 1;
                    }
                }
            }
        }
        int ok = 0;
        for (int i = 0; i < 9; ++i) {
            if(dp.back()[i]) ok = 1;
        }
        puts(ok ? "OK" : "NA");
    }
    return 0;
}
