#include <iostream>

using namespace std;

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

inline bool range_check(int x, int y) {
  return 0 <= x && x <= 9 && 0 <= y && y <= 9;
}

inline bool inside(int x, int y, int k) {
  int kx = xs[k], ky = ys[k];
  return range_check(x, y) && kx-1 <= x && x <= kx+1 && ky-1 <= y && y <= ky+1;
}

bool rec(int x, int y, int k) {
  if (k == n)
    return true;
  for (int i = 0; i < 12; i++)
    if (inside(x+dxs[i], y+dys[i], k) && rec(x+dxs[i], y+dys[i], k+1))
      return true;
  return false;
}

int main() {
  for (;;) {
    int sx, sy;
    cin >> sx >> sy;
    if (!(sx || sy)) return 0;
    cin >> n;
    for (int i = 0; i < n; i++)
      cin >> xs[i] >> ys[i];
    cout << (rec(sx, sy, 0) ? "OK" : "NA")  << endl;
  }
}