#!/usr/bin/env python3 a = input() b = input() try: assert a == str(int(a)) assert b == str(int(b)) result = 'OK' except: result = 'NG' print(result)