#include <iostream>
#include <string>
using namespace std;
 
int main(){
    while (true)
    {
        int x[200] = {};
        int a;
        cin >> a;
        if (cin.eof()) { break; }
        while (true)
        {
            x[a]++;
            x[a] = x[a] % 2;
            cin >> a;
            if (a == 0) { break; }
        }
        int count = 0;
        for(int i=3;i<101;i++){
            if (x[i] == 1) { count++; }
        }
        if(x[1] == 1 && x[2] == 1 && count ==0){
            cout << "OK" << endl;
        }
        else{
            cout << "NO" << endl;
        }
    }
    return 0;
}