#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cerr<<(#v)<<":";for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;
#define printVS(vs) cerr<<(#vs)<<":"<<endl;for(auto(s):(vs)){cerr<<(s)<< endl;}
#define printVV(vv) cerr<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;}
#define printP(p) cerr<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cerr<<(#vp)<<":"<<endl;for(auto(p):(vp)){cerr<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cerr << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cerr << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1ll << 60;
const int mod = 1e9 + 7;
using Graph = vector<vector<int>>;

const int H = 10;
const int W = 10;

bool inside(int x, int y) {
    return 0 <= x && x < H && 0 <= y && y < W;
}

bool validMove(int dx, int dy) {
  return (abs(dx) == 2) ^ (abs(dy) == 2);
}

bool existValidState(const vvi& vv) {
  rep(x, H) {
    rep(y, W) {
      if (vv[x][y] == 1) return true;
    }
  }
  return false;
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int sx, sy;
    while (cin >> sx >> sy) {
      if (sx == 0 && sy == 0) return 0;
      int n;
      cin >> n;
      vector<Pii> vp(n + 1);
      rep2(t, 1, n + 1) {
        int x, y;
        cin >> x >> y;
        vp[t] = Pii(x, y);
      }

      vvvi dp(n + 1, vvi(H, vi(W, 0)));
      dp[0][sx][sy] = 1;
      rep(t, n) {
        rep(x, H) {
          rep(y, W) {
            if (dp[t][x][y] == 0) continue;
            // cerr << "t = " << t << ", x = " << y << ", y = " << x << endl;
            // cerr << "vp[t+1].first = " << vp[t+1].second << ", vp[t+1].second = " << vp[t+1].second << endl;
            for (int dx = -2; dx <= 2; dx++) {
              for (int dy = -2; dy <= 2; dy++) {
                if (!validMove(dx, dy)) continue;
                int nx = x + dx;
                int ny = y + dy;
                if (!inside(nx, ny)) continue;
                // cerr << "nx = " << ny << ", ny = " << nx << endl;
                if (abs(vp[t+1].first - nx) <= 1 && abs(vp[t+1].second - ny) <= 1) {
                  dp[t+1][nx][ny] = 1;
                }
              }
            }
          }
        }
      }

      cout << (existValidState(dp[n]) ? "OK" : "NA") << endl;

      // rep(t, n + 1) {
      //   cerr << "t = " << t << ":" << endl;
      //   rep(x, H) {
      //     rep(y, W) {
      //       cerr << dp[t][y][x];
      //     }
      //     cerr << endl;
      //   }
      //   cerr << endl;
      // }
    }
}

