#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define pb push_back
#define f first
#define s second

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

main(){
  int sx,sy;
  while(cin>>sx>>sy){
    if(sx==0 && sy==0)break;
    int n;
    cin>>n;
    PI sp[n];
    rep(i,n)cin>>sp[i].f>>sp[i].s;

    queue<pair<PI,int> > Q;
    Q.push(mp(mp(sx,sy),0));

    int maxn=0;

    while(!Q.empty()){
      int x=Q.front().f.f,y=Q.front().f.s,te=Q.front().s;
      Q.pop();
      maxn=te;
      if(te==n)break;
      rep(i,12){
        int nx=x+dx[i];
        int ny=y+dy[i];
        if(nx<0 || nx>9 || ny<0 || ny>9 || abs(nx-sp[te].f)>1 || abs(ny-sp[te].s)>1)continue;
        Q.push(mp(mp(nx,ny),te+1));
      }
    }
    if(maxn==n)puts("OK");
    else puts("NA");
  }
}