#include <iostream>
#include <algorithm>
#include <queue>

using namespace std;

struct P{
  int x;
  int y;
  int t;
  int c;
};

int mdx[9] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int mdy[9] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
int xdir[12] = {-1, 0, 1, -2, 2, -2, 2, -2, 2, -1, 0, 1};
int ydir[12] = {-2, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 2};

void aprint(bool a[10][10][11], int x, int y)
{
  for(int i = 0; i < 10; i++){
    for(int j = 0; j < 10; j++){
      bool f = true;
      if(i == y && j == x){
	cout << "  p";
	f = false;
      }
      for(int k = 10; k >= 0 && f; k--){
	if(a[i][j][k]){
	  f= false;
	  printf(" %2d", k);
	}
      }
      if(f){
	  cout << "  .";
      }
    }
    cout << endl;
  }
  
  return ;
}

bool bfs(bool a[10][10][11], int sx, int sy, int n)
{
  bool f = false;
  queue<P> que;
  P p, q;
  p.x = sx;
  p.y = sy;
  p.t = p.c = 0;
  que.push(p);
  int dx, dy;
  if(n == 0){
    return f;
  }
  while(!que.empty() && !f){
    p = que.front();
    que.pop();
    if(p.c == 1){
      f = true;
      break;
    }
    if(p.t == n){
      for(int i = 0; i < 12; i++){
        dx = p.x+xdir[i];
	dy = p.y+ydir[i];
        if(0 <= dx && dx <= 9 && 0 <= dy && dy <= 9){
          if(a[dy][dx][1] == true){
            q.x = dx;
	    q.y = dy;
	    q.t = 1;
	    q.c = p.c+1;
	    que.push(q);
          }
        }
      }
    } else {
      for(int i = 0; i < 12; i++){
	dx = p.x+xdir[i];
	dy = p.y+ydir[i];
	if(0 <= dx && dx <= 9 && 0 <= dy && dy <= 9){
	  if(a[dy][dx][p.t+1]){
	    q.x = dx;
	    q.y = dy;
	    q.t = p.t+1;
	    q.c = p.c;
	    que.push(q);
	  }
	}
      }
    }
  }

  return f;
}

int main()
{
  int s, t, u, v, n;
  bool a[10][10][11];

  while(cin>>s>>t && (s+t)){
    cin >> n;
    fill(&a[0][0][0], &a[9][9][10], false);
    
    for(int i = 1; i <= n; i++){
      cin >> u >> v;
      for(int j = 0; j < 9; j++){
	int x = u+mdx[j], y = v+mdy[j];
	if(0 <= x && x <= 9 && 0 <= y && y <= 9){
	  a[y][x][i] = true;
	}
      }
    }

    cout << ((bfs(a, s, t, n))? "OK":"NA") << endl;
  }

  return 0;
}