#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
const int dy[] = {2, 2, 2, -1, 0, 1, -2, -2, -2, -1, 0, 1};
const int dx[] = {-1, 0, 1, 2, 2, 2, -1, 0, 1, -2, -2, -2};
int n;
int sy[10], sx[10];
bool inRange(int y, int x)
{
    if(y < 0 or x < 0 or y >= 10 or x >= 10) return false;
    return true;
}
bool dfs(int py, int px, int depth)
{
    if(depth == n) return true;
    vector<vector<int>> field(10, vector<int>(10, 0));
    for(int i = -1; i <= 1; i++)
    {
        for(int j = -1; j <= 1; j++)
        {
            int ny = sy[depth] + i, nx = sx[depth] + j;
            if(inRange(ny, nx)) field[ny][nx] = 1;
        }
    }
    bool res = false;
    for(int i = 0; i < 12; i++)
    {
        int ny = py + dy[i];
        int nx = px + dx[i];
        if(not inRange(ny, nx)) continue;
        if(field[ny][nx]) res |= dfs(ny, nx, depth + 1);
    }
    return res;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int px, py;
    while(cin >> px >> py, px | py)
    {
        cin >> n;
        for(int i = 0; i < n; i++) cin >> sx[i] >> sy[i];
        cout << (dfs(py, px, 0) ? "OK" : "NA") << endl;
    }
    return 0;
}


