#include <iostream>
#include <map>
using namespace std;

int main(void)
{
	int u, v;
	map <int, int> m;
	
	while (cin >> u >> v){
		if (u == 0 && v == 0){
			bool flag = true;
			map <int, int> ::iterator it;
			for (it = m.begin(); it != m.end(); it++){
				if (it->first == 1 && it->second % 2 == 0) flag = false;
				else if (it->first == 2 && it->second % 2 == 0) flag = false;
				else if (2 < it->first && it->second % 2 == 1){
					flag = false;
					break;
				}
			}
			if (flag) puts("OK");
			else puts("NO");
			continue;
		}
		m[u]++;
		m[v]++;
	}
	
	return 0;
}