#include <iostream>
#include <sstream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
#define X first
#define Y second

vector<double> data;
pair<double,double> lc;
vector<bool> done;

int boxSize;
bool flag;

double solve(double x,double a,double b){
	return (2.0*x+sqrt(4*x*x-4*(x*x-4*a*b)) ) / 2.0;
}

void bt(){
	if( count(done.begin(),done.end(),true) == done.size() ){
		if( lc.X + lc.Y<=boxSize){
			flag = true;
		}
	}
	if(flag || lc.X + lc.Y > boxSize)return;
	
	for(int i=0;i<data.size();i++){
		if(done[i])continue;
		
		if(solve(lc.X,lc.Y,data[i]) > boxSize)continue;
		done[i] = true;
		pair<double,double> tmp = lc;
		lc = make_pair(solve(lc.X,lc.Y,data[i]),data[i]);
		bt();
		lc = tmp;
		done[i] = false;
	}
}


int main(){
	int t;
	string s;
	while(getline(cin,s) && s != ""){
		vector<int> input;
		flag = false;
		data.clear();
		
		stringstream ss(s);
		while(ss >> t)input.push_back(t);
		
		boxSize = input[0];
		for(int i=1;i<input.size();i++){
			data.push_back(input[i]);
		}
		done.resize(data.size());
		fill(done.begin(),done.end(),false);
		for(int i=0;i<data.size();i++){
			done[i] = true;
			lc = make_pair(data[i],data[i]);
			bt();
			done[i] = false;
		}
		cout << (flag?"OK":"NG") << endl;
	}
}