#include<iostream>
#include<map>
#include<vector>
#include<queue>

#define F first
#define S second

using namespace std;

typedef pair<int,int> P;
int sx, sy;
int n;
vector<P> s;
queue<P> que;

int dx[] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2};
int dy[] = {2, 2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1};

bool bfs(void){
  while(que.size()) que.pop();
  que.push(P(sx,sy));

  int d[11][11];

  for(int i = 0;i < 11; i++)
    for(int j = 0;j < 11; j++) d[i][j] = -1;

  d[sy][sx] = 0;

  while(que.size()){
    P p = que.front(); que.pop();
    if(d[p.S][p.F] == n) return true;
    
    for(int i = 0;i < 12; i++){
      int nx = p.F + dx[i], ny = p.S + dy[i];
     
      if(nx < 0 || ny < 0 || nx >= 10 || ny >= 10) continue;
      if(d[ny][nx] != -1) continue;
      
      int x = d[p.S][p.F];
      if(s[x].F-1 <= nx && nx <= s[x].F+1 && s[x].S-1 <= ny && ny <= s[x].S+1){
	d[ny][nx] = x + 1;
	que.push(P(nx,ny));
      }
    }
  }
  return false;
}

int main(void){

  for( ; ; ){
    cin >> sx >> sy;
    if(!sx && !sy) break;

    cin >> n;
    s.clear();
    for(int i = 0;i < n; i++){
      P p;
      cin >> p.F >> p.S;
      s.push_back(p);
    }

    bool t = bfs();
    cout << (t? "OK" : "NA") << endl;
  }
}
