#include <bits/stdc++.h>
using namespace std;

const int pyonX[] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2};
const int pyonY[] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1};

int main() {
  int px, py;
  while (cin >> px >> py, px) {
    int n; cin >> n;
    auto g = vector<vector<int>>(10, vector<int>(10, -1));
    g[py][px] = 0;
    while (n--) {
      int x, y; cin >> x >> y;
      auto gg = g;
      for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
          if (g[i][j]) continue;
          gg[i][j] = -1;
          for (int c = 0; c < 12; ++c) {
            int ty = i + pyonY[c];
            int tx = j + pyonX[c];
            if (0 <= ty && ty < 10 && 0 <= tx && tx < 10) {
              gg[ty][tx] = 1;
            }
          }
        }
      }
      for (int i = -1; i <= 1; ++i) {
        for (int j = -1; j <= 1; ++j) {
          int ty = i + y;
          int tx = j + x;
          if (0 <= ty && ty < 10 && 0 <= tx && tx < 10) {
            ++gg[ty][tx];
          }
        }
      }
      for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
          g[i][j] = (gg[i][j] > 1) - 1;
        }
      }
      // for (int i = 0; i < 10; ++i) {
      //   for (auto&& x : g[i]) cout << setw(3) << right << x; cout << endl;
      // }
      // cout << endl;
    }
    bool ans = false;
    for (int i = 0; i < 10; ++i) {
      for (int j = 0; j < 10; ++j) {
        if (!g[i][j]) ans = true;
      }
    }
    cout << ( (ans) ? "OK" : "NA" ) << endl;
  }
  return 0;
}

