#include <iostream>
#include <algorithm>
using namespace std;

int jump[12][2] = {{-1,2},{0,2},{1,2},{2,1},{2,0},{2,-1},{1,-2},{0,-2},{-1,-2},{-2,-1},{-2,0},{-2,1}};
int xs[10], ys[10];

bool shower(int xp, int yp, int xscr, int yscr) {
  return ((xp>=xscr-1)&&(xp<=xscr+1)&&(yp>=yscr-1)&&(yp<=yscr+1));
}

bool in_park(int xp, int yp) {
  return ((xp>=0) && (xp<10) && (yp>=0) && (yp<10));
}

bool dfs(int x, int y, int n) {
  if (!n) return true;
  int xx, yy, nn;

  nn = n-1;
  for (int i=0; i<12; i++) {
    xx = x + jump[i][0];
    yy = y + jump[i][1];
    if (!in_park) continue;
    if (shower(xx, yy, xs[nn], ys[nn])) {
      if (dfs(xx, yy, nn)) return true;
    }
  }
  return false;
}

int main() {
  int n, x0, y0;
  while (1) {
    cin >> x0 >> y0;
    if (!x0 && !y0) break;
    cin >> n;
    for (int i=0; i<n; i++) {
      cin >> xs[i] >> ys[i];
    }
    reverse(xs, xs+n);
    reverse(ys, ys+n);

    if (dfs(x0, y0, n)) {
      cout << "OK" << endl;
    } else {
      cout << "NA" << endl;
    }
  }
  return 0;
}