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

bool mas[11][10][10];
int sy, sx, n;
int dy[] = { -2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1};
int dx[] = { -1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2};

bool dfs(int y, int x, int idx){
  if(idx == n) return true;
  for(int i = 0; i < 12; i++){
    int ny = y + dy[i], nx = x + dx[i];
    if(ny < 0 || ny >= 10 || nx < 0 || nx >= 10 || !mas[idx][ny][nx]) continue;
    if(dfs( ny, nx, idx + 1)) return true;
  }
  return false;
}

int main(){

  while(cin >> sx >> sy, sx||sy){
    memset( mas, false, sizeof(mas));

    cin >> n;

    int y0, x0;

    for(int i = 0; i < n; i++){
      int y, x;
      cin >> x >> y;

      mas[i][y][x] = true;
      for(int j = -1; j <= 1; j++){
        for(int k = -1; k <= 1; k++){
          int ny = y + j, nx = x + k;
          if(ny < 0 || ny >= 10 || nx < 0 || nx >= 10) continue;
          mas[i][ny][nx] = true;
        }
      }
    }
    puts(dfs( sy, sx, 0) ? "OK" : "NA");
  }
}

  