#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <sstream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (1<<10)
double solve(double &x,int &a,int &b){
	return x + sqrt(4*a*b);
}

#define shift(n) (1<<n)

string solve(int &capacity,vector<int> &item){
	int n = item.size();
	double dp[1<<n][n];
	
	rep(i,1<<n)rep(j,n)dp[i][j] = INF;
	
	rep(i,n)dp[1<<i][i] = item[i];
	
	rep(bit,1<<n){
		rep(rmost,n){
			if( (shift(rmost) & bit) == 0 )continue;
			rep(cur,n){
				if(shift(cur) & bit)continue;
				int nextBit = bit | shift(cur);
				dp[nextBit][cur] = min(dp[nextBit][cur],solve(dp[bit][rmost],item[rmost],item[cur]) );
			}
		}
	}
	rep(i,n){
		if(dp[(1<<n)-1][i] + item[i]<= capacity)return "OK";
	}
	return "NA";
}
int main(){
	string line;
	int tmp;
	while(getline(cin,line)){
		while(~line.find(","))line[line.find(",")] = ' ';
		stringstream input(line);
		int capacity;
		vector<int> item;
		
		input >> capacity;
		while(input >> tmp)item.push_back(tmp);
		cout << solve(capacity,item) << endl;
	}
}