//38
#include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<cmath>
#include<map>
 
using namespace std;

map<pair<vector<int>,int>,double> memo;

vector<int> c;

double dfs(int nr,int p){
  if(nr==0){
    return p;
  }else if(memo.count(make_pair(c,p))){
    return memo[make_pair(c,p)];
  }else{
    double md=1<<30;
    for(int i=3;i<=10;i++){
      if(c[i]){
	c[i]--;
	md=min(md,dfs(nr-1,i)+2*sqrt(i*p));
	c[i]++;
      }
    }
    memo[make_pair(c,p)]=md;
    return md;
  }
}
 
int main(){
  for(int w;cin>>w;){
    string s;
    getline(cin,s);
    stringstream ss(s);
    c=vector<int>(11);
    memo.clear();
    int nr=0;
    for(int r;ss>>r;){
      c[r]++;
      nr++;
    }
    int i;
    for(i=3;i<=10;i++){
      if(c[i]){
	c[i]--;
	if(dfs(nr-1,i)+i<=w)break;
	c[i]++;
      }
    }
    cout<<((i<=10)?"OK":"NA")<<endl;
  }
  return 0;
}