#include<iostream>
#include<queue>
#include<map>
using namespace std;

#define abs(x) (x>0 ? x : -(x))

typedef pair<int, int> P;
typedef pair<int, P> IP;

#define N 10
#define W 12

int main() {
  int x0, y0;
  int X[W] = {-2,-2,-2,-1, 0, 1, 2, 2, 2, 1, 0,-1};
  int Y[W] = { 1, 0,-1,-2,-2,-2,-1, 0, 1, 2, 2, 2};
  while(cin >> x0 >> y0 && x0+y0) {
    queue<IP> que;
    int n, x, y;
    cin >> n;
    que.push(IP(0, P(x0, y0)));
    for(int i=0; i<n; ++i) {
      cin >> x >> y;
      while(!que.empty() && que.front().first == i) {
        int xa = que.front().second.first, ya = que.front().second.second; que.pop();
        for(int j=0; j<W; ++j) {
          int nx = xa + X[j], ny = ya + Y[j];
          if(nx < 0 || 9 < nx || ny < 0 || 9 < ny) continue;
          if(abs(nx - x)<=1 && abs(ny - y)<=1) {
            que.push(IP(i+1, P(nx, ny)));
          }
        }
      }
    }
    cout << (que.empty() ? "NA" : "OK") << endl;
  }
  return 0;
}