#include "bits/stdc++.h"
using namespace std;
using ll = long long;

int main()
{
	int K,A,B,i;
	string S;
	cin >> K >> A >> B;
	//vector<int> a(N);
	for(i=A;i<=B;++i)
	{
		if (i % 7 == 0)
		{
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
}
