#include<stdio.h>

int main()
{
 int K,A,B,distance;
scanf("%d",&K);
scanf("%d %d",&A,&B);

scanf("%d",&distance);
int remainder=distance%K;

if(remainder==0 && distance>=A && distance<=B){ 
printf("OK\n");}

else{ printf("NG\n");}

    return 0;
}