from collections import defaultdict def main(): A = input() B = input() if A.isnumeric() and B.isnumeric(): if 0 <= int(A) <= 12345 and 0 <= int(B) <= 12345: print("OK") return print("NG") if __name__ == '__main__': main()