//38
#include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<cmath>
 
using namespace std;
 
int c[11];
 
bool dfs(double r,int nr,int p){
  if(nr==0){
    return r>=p;
  }else{
    for(int i=3;i<=10;i++){
      if(c[i]){
	c[i]--;
	if(dfs(r-2*sqrt(i*p),nr-1,i))return true;
	c[i]++;
      }
    }
    return false;
  }
}
 
int main(){
  for(int w;cin>>w;){
    string s;
    getline(cin,s);
    stringstream ss(s);
    fill(c,c+11,0);
    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(w-i,nr-1,i))break;
	c[i]++;
      }
    }
    cout<<((i<v.size())?"OK":"NA")<<endl;
  }
  return 0;
}