#include<iostream>
#include<vector>
#include<cmath>
#include<cassert>
#include<algorithm>

#define MAX 12

using namespace std;

typedef unsigned int set;

typedef struct tagcombstruct{
	set K,N,x,overx;
} combStruct;

int g_cnt;

/* gencomb1 from http://www5.airnet.ne.jp/tomy/cpro/pe1.htm (C) Tomy */
set nextset(set x){
	set smallest, ripple, new_smallest, ones;

	smallest = x & (~x+1);
	ripple = x + smallest;
	new_smallest = ripple & (~ripple+1);
	ones = ((new_smallest / smallest) >> 1) - 1;

	return ripple | ones;
}
bool subcomb(set p[], combStruct &cmst){
	set tj, *tq;
	set ts;

	cmst.x = nextset(cmst.x);

	if(cmst.x & cmst.overx) return false;
	for(tj = 1, tq = p, ts = cmst.x; tj <= cmst.N; tj++){ if(ts & 1) *tq++ = tj; ts >>= 1; }
	return true;
}
vector<pair<int, int> > myunique(const vector<int> &v){
	vector<pair<int, int> > vret;
	unsigned int now;

	for(unsigned int i = 0; i < v.size(); i++) vret.push_back( make_pair(v[i],0) );
	now = 0;
	while( now < vret.size() ){
		int cnt = 1;
		for(unsigned int i = now+1; i < vret.size(); ++i){
			if( vret[i].first != vret[i - 1].first ) break;
			else cnt++;
		}
		for(unsigned int i = now; i < now + cnt; ++i) vret[i].second = cnt;
		now += cnt;
	}
	while( true ){
		vector<pair<int, int > >::iterator itV = unique( vret.begin(), vret.end() );
		if( itV != vret.end() ) vret.erase( itV, vret.end() );
		else break;
	}
	return vret;
}
bool Solve3(pair<int, bool> *box, set num, set combn, vector<pair<int,int> > &v, int pos, long double w){
	if( pos == v.size() ){
		/*g_cnt++;
		if( g_cnt % 5000000 == 0 ){
			cout << g_cnt << endl;
		}*/
		/*
		long double ret;
		ret = box[0].first + box[num - 1].first;
		for(unsigned int i = 0; i < num - 1; ++i){
			ret += 2 * sqrt((long double)(box[i].first * box[i+1].first));
		}
		if( ret <= w ){
			//cout << ret << endl;
			return true;
		}*/
	}else{
		combStruct cmst;
		set p[MAX];
		set j, *q;
		set s;
		//int ePlacesNum = 0;
		//int eplaces[MAX];

		/*for(unsigned int i = 0; i < num; i++) if( !box[i].second ){
			eplaces[ePlacesNum] = i;
			ePlacesNum++;
		}*/
		cmst.N = combn;
		cmst.K = v[pos].second;
		cmst.x = ( 1 << cmst.K ) - 1L;
		cmst.overx = ~( ( 1 << cmst.N ) - 1L );

		for(j = 1, q = p, s = cmst.x; j <= cmst.N; j++){ if(s & 1) *q++ = j; s >>= 1; }
		do{
			// TODO
			/*for(int i = 0; i < cmst.K; i++){
				cout << p[i] << ' ';
			}
			cout << endl;*/
			//cout << '(' << cmst.K << ',' << vEmptyPlaces.size() << ")\n";
			/*for(unsigned int i = 0; i < cmst.K; ++i){
				box[ eplaces[p[i] - 1] ] = make_pair( v[pos].first, true );
			}*/
			
			if( Solve3( box, num, combn-cmst.K, v, pos+1, w ) ) return true;

			/*for(unsigned int i = 0; i < cmst.K; ++i){
				box[ eplaces[p[i] - 1] ] = make_pair( 0, false );
			}*/
		}while( subcomb( p, cmst ) );
	}
	return false;
}
int main(void){
	while(true){
		int num = 0;
		long double boxLength;
		pair<int,bool> box[MAX];
		vector<pair<int,int> > vRCakes;
		vector<int> vCakes;
		
		cin >> boxLength;
		if( cin.eof() ) break;
		while( true ){
			int tmp;

			if( '\n' == cin.get() ) break;
			cin >> tmp;
			vCakes.push_back( tmp );
			box[num].first = 0;
			box[num].second = false;
			num++;
		}

		sort(vCakes.begin(), vCakes.end());

		// unique
		vRCakes = myunique(vCakes);

		g_cnt = 0;
		if( Solve3(box,num,num,vRCakes,0,boxLength) ) cout << "OK\n";
		else cout << "NA\n";
		//cout << g_cnt << endl;
	}
	return 0;
}