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: if A[0] != "0" and B[0] != "0": print("OK") return print("NG") if __name__ == '__main__': main()