#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600

bool solve(int px, int py){
  int n;
  cin>>n;
  vector<int> sx(n), sy(n);
  rep(i,n) cin>>sx[i]>>sy[i];

  vector<int> x,y;
  x.pb(px); y.pb(py);
  rep(i,n){
    vector<int> xx,yy;
    rep(j,x.size()){
      const int dx[]={-2,-2,-2,2,2,2,-1,0,1,-1,0,1};
      const int dy[]={-1,0,1,-1,0,1,-2,-2,-2,2,2,2};
      rep(k,12){
        int nx = x[j]+dx[k];
        int ny = y[j]+dy[k];
        if(nx<0 || nx>9 || ny<0 || ny>9) continue;
        if(abs(nx-sx[i])<=1 && abs(ny-sy[i])<=1){//dbg(mp(nx,ny));
          xx.pb(nx);
          yy.pb(ny);
        }
      }
    }
    swap(xx,x);
    swap(yy,y);
  }
  return x.size()>0;
}

int main(){
  int x,y;
  while(cin>>x>>y, x|y){
    if(solve(x,y)) cout<<"OK"<<endl;
    else cout<<"NA"<<endl;
  }
  return 0;
}