#include<bits/stdc++.h>
#define mk make_pair
using namespace std;
int dx[]={2,2,2,1,1,0,0,-1,-1,-2,-2,-2};
int dy[]={1,0,-1,2,-2,2,-2,2,-2,1,0,-1};
int n,px,py,x[11],y[11];
bool dfs(int sx,int sy,int d){
  if(d==n)return 1;
  int qx=x[d],qy=y[d];
  for(int i=0;i<12;i++){
    int gx=sx+dx[i],gy=sy+dy[i];
    if(abs(gx-qx)<=1&&abs(gy-qy)<=1&&gy>=0&&gx>=0&&gy<10&&gx<10)
      if(dfs(gx,gy,d+1))return 1;
  }
  return 0;
}
int main(){
  while(cin>>px>>py,px+py){
    cin>>n;
    for(int i=0;i<n;i++)cin>>x[i]>>y[i];
    if(dfs(px,py,0))cout<<"OK"<<endl;
    else cout<<"NO"<<endl;
  }
}