#include<iostream>
#include<utility>
#include<vector>
using namespace std;

int main(){
  bool water[10][10];
  bool frog[10][10];
  int x,y;
  int sp[10][2];
  int n;

  while(1){
    cin >> x >> y;
    if(!x && !y)break;

    cin >> n;
    for(int i=0;i<n;i++)cin >> sp[i][0] >> sp[i][1];

    vector<pair<int,int> > pyon[11];
    pyon[0].push_back(make_pair(x,y));

    for(int i=0;i<n;i++){
      if(pyon[i].size()){
	for(int j=0;j<10;j++){
	  for(int k=0;k<10;k++){
	    water[j][k] = false;
	    frog[j][k] = false;
	  }
	}

	for(int j=sp[i][1]-1;j<=sp[i][1]+1;j++){
	  for(int k=sp[i][0]-1;k<=sp[i][0]+1;k++){
	    if(k<0 || k>=10 || j<0 || j>=10)continue;
	    water[j][k] = true;
	  }
	}

	for(int k=0;k<(int)pyon[i].size();k++){
	  int dx = pyon[i][k].first,dy = pyon[i][k].second;
	  for(int j=dy-1;j<=dy+1;j++){
	    if(j < 0 || j >= 10)continue;
	    if(dx-2 >= 0)frog[j][dx-2] = true;
	    if(dx+2 < 10)frog[j][dx+2] = true;
	  }
	  for(int j=dx-1;j<=dx+1;j++){
	    if(j < 0 || j >= 10)continue;
	    if(dy-2 >= 0)frog[dy-2][j] = true;
	    if(dy+2 < 10)frog[dy+2][j] = true;
	  }
	}

	for(int j=0;j<10;j++){
	  for(int k=0;k<10;k++){
	    if(water[j][k] && frog[j][k])pyon[i+1].push_back(make_pair(k,j));
	  }
	}
      }
    }

    if(pyon[n].size())cout << "OK" << endl;
    else cout << "NA" << endl;
  }
}