#define f strtol(gets(s),&t,10)>12345|*t|(*s==48&&s[1]) n;char*t,s[];main(){n=!puts(f|f?"NG":"OK");}