#include <stdio.h>
#include <math.h>
#include <stdlib.h>

#define MAX_LEN 256
#define MAX_NUM 12
#define MAX_SQRT 100

void init_map(int num);
void init_sqrt(void);

double getmin(int pat,int r,int ad,int num);
double getmin2(int pat,int ad,int num);
double getmin3(int num);

int cake[MAX_NUM]; /* P[LTCY */
double min; /* ÅKð */

double sq[MAX_SQRT+1];/* [gvZÊ */

double map[1<<MAX_NUM][MAX_NUM];

int main(){
	char buf[MAX_LEN];
	int num; /* P[LÂ */
	int width; /*  Ì·³ */
	int offset; /* obt@àùÇÊu */
	int oftmp;
	
	init_sqrt();
	
	while(fgets(buf,MAX_LEN,stdin)!=NULL){
		/* Âæ¾ */
		sscanf(buf,"%d%n",&width,&oftmp);
		offset = oftmp;
		/* TCYæ¾ */
		num = 0;
		while(sscanf(buf+offset,"%d%n",&cake[num],&oftmp) > 0){
			offset+=oftmp;
			num++;
		}
		
		/* èvZ */
		init_map(num);
		
		min = getmin3(num);
		//printf("%d %.5f\n",width,min);
		printf(min<=width?"OK\n":"NG\n");
	}
	return 0;
}

void init_sqrt(void){
	int i;
	for(i=0;i<MAX_SQRT+1;i++){
		sq[i] = 2*sqrt(i);
	}
}

void init_map(int num){
	int i,j;
	for(i=0;i<(1<<num);i++){
		for(j=0;j<num;j++){
			map[i][j]=0;
		}
	}
	for(i=0;i<num;i++){
		map[1<<i][i] = 2*cake[i];
	}
}

double getmin(int pat,int r,int ad,int num){
	double min; /* ¡ñßéÅ¬lißèlj */
	double premin; /* patÆrÅÌÅ¬l */
	double premintmp;
	int i,bit;
	int prepat;/* pat©çrð²¢½p^[ */
	
	premin = map[pat][r];
	if(premin==0){
		premin = 99999;
		prepat = pat - (1<<r);
		for(i=0;i<num;i++){
			bit = 1<<i;
			if((bit&prepat)!=0){
				premintmp = getmin(prepat,i,r,num);
				if(premintmp<premin){
					premin=premintmp;
				}
			}
		}
		map[pat][r] = premin;
	}
	pat += (1<<ad);
	min = premin - cake[r] + sq[cake[r]*cake[ad]] + cake[ad];
	map[pat][ad] = min;
	return min;
}

double getmin2(int pat,int ad,int num){
	int i,bit;
	double min,ret;
	min = 99999;
	for(i=0;i<num;i++){
		bit = 1<<i;
		if((bit&pat)!=0){
			ret = getmin(pat,i,ad,num);
			if(ret<min)min=ret;
		}
	}
	return min;
}

double getmin3(int num){
	int i,bit,pat;
	double min,ret;
	min = 99999;
	pat = (1<<num)-1;
	for(i=0;i<num;i++){
		bit = 1<<i;
		ret = getmin2(pat-bit,i,num);
		if(ret<min)min=ret;
	}
	return min;
}