#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 103
#define GOAL 2
int main(void)
{
	int kousa[MAX] = { 0 };
	int a, b, cou = 0;
	while (scanf_s("%d %d",&a,&b) != EOF) {
		if (a == 0 && b == 0) {
			for (int i = GOAL + 1; i <= cou; ++i) {
				if (kousa[i] % 2 != 0) {
					kousa[i] = 0;
					printf("NO\n"); break;
				}
				else if (i == cou) {
					kousa[i] = 0;
					printf("OK\n");
				}
			}
			cou = 0;
		}
		else {
			++kousa[a]; ++kousa[b];
			if (cou < a) cou = a;
			if (cou < b) cou = b;
		}
	}
}