#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

int n;
int sx[11];
int sy[11];

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

bool dps(int k, bool *flag){
  if(k == n){
    bool ret = false;
    REP(i, 9) ret |= flag[i];
    return ret;
  }

  bool nflag[9] = { false };

  int x  = sx[k]  , y  = sy[k];
  int nx = sx[k+1], ny = sy[k+1];
  REP(i,9){
    if(flag[i]){
      int xx = x + (i % 3) - 1;
      int yy = y + (i / 3) - 1;
      REP(j,12){
        int xxx = xx + dx[j];
        int yyy = yy + dy[j];
        if(xxx < 0) continue;
        if(yyy < 0) continue;
        if(xxx > 9) continue;
        if(yyy > 9) continue;
        if(abs(xxx-nx) <= 1 && abs(yyy-ny) <= 1){
          int pos = (xxx - nx + 1) + (yyy - ny + 1) * 3;
          nflag[pos] = true;
        }
      }
    }
  }

  return dps(k+1, nflag);
}

int main(){
  while(scanf("%d%d",&sx[0],&sy[0]), sx[0]+sy[0]){
    bool flag[9] =
      { 0, 0, 0,
        0, 1, 0,
        0, 0, 0 };

    scanf("%d",&n);
    REP(i,n) scanf("%d%d",&sx[i+1], &sy[i+1]);

    puts(dps(0, flag) ? "OK" : "NA");
  }
  return 0;
}