#include <iostream>
#include <vector>
using namespace std;
#define MAP_SIZE 10

class Pos {
  public:
    Pos(int x, int y) : x(x), y(y) {}
    int x;
    int y;
    bool alive(Pos p) {
      if (p.x - 1 <= this->x && this->x <= p.x + 1 && p.y - 1 <= this->y && this->y <= p.y + 1) return true;
      return false;
    }
};

int x[12] = {-2, -2, -2, 2, 2, 2, -1, 0, 1, -1, 0, 1};
int y[12] = {-1, 0, 1, -1, 0, 1, -2, -2, -2, 2, 2, 2};
bool move(Pos p, vector<Pos> sc, int n) {
  if (p.x < 0 || MAP_SIZE <= p.x || p.y < 0 || MAP_SIZE <= p.y) return false;
  if (n == -1) return true;
  if (!p.alive(sc[n--])) return false;
  sc.pop_back();
  bool result = false;
  for (int i = 0; i < 12; i++) {
    if (move(Pos(p.x + x[i], p.y + y[i]), sc, n)) result = true;
    if (result) break;
  }
  return result;
}

int main() {
  int x, y;
  while (cin >> x >> y) {
    if (x == 0 && y == 0) break;
    Pos p = Pos(x, y);

    int n;
    cin >> n;
    vector<Pos> sc;
    sc.insert(sc.begin(), p);
    for (int i = 0; i < n; i++) {
      int scX, scY;
      cin >> scX >> scY;
      Pos s = Pos(scX, scY);
      sc.insert(sc.begin(), s);
    }
    cout << (move(p, sc, n) ? "OK" : "NA") << endl;
  }
  return 0;
}