class Sprinkler
  def initialize(index, x, y)
    @index = index
    @x = x
    @y = y
  end

  def in_range?(x, y)
    diff_x = (@x - x).abs
    diff_y = (@y - y).abs
    diff_x <= 1 && diff_y <= 1
  end
end

def movable_point(x, y)
  return [[x-1, y+2], [x, y+2], [x+1, y+2],
          [x+2, y+1], [x+2, y], [x+2, y-1],
          [x+1, y-2], [x, y-2], [x-1, y-2],
          [x-2, y-1], [x-2, y], [x-2, y+1]]
end

def calc
  l = gets.chomp
  exit if l == "0 0"

  # initial position
  init = l.split(" ").map {|x| x.to_i}

  # num of sprinkler
  n = gets.chomp.to_i

  # sprinkler position
  pos = gets.split(" ").map {|x| x.to_i}
  sprinklers = Array.new
  n.times do |i|
    sprinkler = Sprinkler.new(i, pos[2*i], pos[2*i+1] )
    sprinklers.push sprinkler
  end

  path = Array.new
  path.push init

  nextPath = Array.new
  # ??????????????????????????°?????°?????????
  for sprinkler in sprinklers do
    # ???????????§?????°??????????????§?¨?
    path.each do |point|
      # ?????¨??°??????????§???????????????§?¨?
      movable_point(point[0], point[1]).each do |movable|
        nextPath.push movable if sprinkler.in_range? movable[0], movable[1]
      end
    end
    if nextPath.length == 0 then
      puts "NA"
      return
    end
    path = nextPath.clone
    nextPath.clear
  end
  puts "OK"
  return
end

# input
while true do
  calc
end