# -*- coding: utf-8 -*- def is_int_str(string): is_int = None try: int(string) is_int = True except ValueError: is_int = False return is_int A = input() B = input() if is_int_str(A) and is_int_str(B): if str(int(A)) == A and str(int(B)) == B: print('OK') else: print('NG') else: print('NG')