#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool f;
double w;
vector<double> v;
int n;
double calc(int i,int j){
  return sqrt((v[i]+v[j])*(v[i]+v[j])-(v[i]-v[j])*(v[i]-v[j]));
}
double memo[1<<12][12];
void dfs(double l,int b,int p){
  if(~p){
    if(memo[b][p]<=l) return;
    memo[b][p]=l;
  }
  if(b==(1<<n)-1){
    f|=l+v[p]<=w;
    return;
  }
  if(p<0) for(int i=0;i<n;i++) dfs(v[i],b+(1<<i),i);
  else for(int i=0;i<n;i++) if(!((b>>i)&1)) dfs(l+calc(p,i),b+(1<<i),i);
}
int main(){
  string s;
  while(getline(cin,s)){
    v.clear();
    stringstream ss(s);
    ss>>w;
    double t;
    while(ss>>t) v.push_back(t);
    n=v.size();
    f=0;
    
    for(int i=0;i<(1<<n);i++) 
      for(int j=0;j<n;j++)
	memo[i][j]=1e9;
    
    dfs(0,0,-1);
    cout<<(f?"OK":"NG")<<endl;
  }
  return 0;
}