#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

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

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int px, py;
  while (cin >> px >> py) {
    if (px == 0 && py == 0) break;
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; i++) {
      cin >> x[i] >> y[i];
      x[i]--, y[i]--;
    }
    bool ok = false;
    auto check = [&](int a, int b, int c, int d) {
      return c - a >= 0 && c - a <= 2 && d - b >= 0 && d - b <= 2;
    };
    using P = pair<int, pii>;
    stack<P> st;
    st.emplace(-1, pii(py, px));
    while (!st.empty()) {
      P p = st.top(); st.pop();
      int id = p.first, sy, sx;
      tie(sy, sx) = p.second;
      if (id == n - 1) {
        ok = true;
        break;
      }
      for (int i = 0; i < 12; i++) {
        int ny = sy + dy[i], nx = sx + dx[i];
        if (ny >= 0 && ny < 10 && nx >= 0 && nx < 10 && check(y[id + 1], x[id + 1], ny, nx)) {
          st.emplace(id + 1, pii(ny, nx));
        }
      }
    }
    cout << (ok ? "OK" : "NA") << endl;
  }

  return 0;
}
