def f(a,b): try:a=int(a);b=int(b) except:return'NG' if 0<=a<12346 and 0<=b<12346:return'OK' return'NG' print(f(input(),input()))