#include <iostream>
#include <cmath>
#include <queue>
using namespace std;

#define EPS 1e-8

double calcR(double r1, double r2)
{
	return sqrt((r1+r2)*(r1+r2)-(r1-r2)*(r1-r2));
}

class Trl
{
public:
	int p, h;
	double c;
	Trl(int p, int h, double c)
	:p(p),h(h),c(c)
	{}
	
	bool operator<(const Trl& t) const
	{
		return c>t.c;
	}
};

int main()
{
	double cst[11][11]={0};
	for(int i=0; i<=10; i++)
		cst[0][i]=2*i;
		
	for(int i=3; i<=10; i++)
	for(int j=3; j<=10; j++)
		cst[i][j]=calcR(i,j)-i+j;
		
	int L;
	while(cin >> L)
	{
		int cake[10], p=0;
		while(cin.peek() != '\n')
			cin >> cake[p++];
		
		priority_queue<Trl> q;
		q.push(Trl(0,0,0));
		bool g=false;
		bool v[12][1<<12]={0};
		while(!q.empty())
		{
			Trl t=q.top(); q.pop();
			if(v[t.p][t.h]) continue;
			v[t.p][t.h]=1;
			
			if(t.h==(1<<p)-1)
			{
				g=true;
				break;
			}
		
			for(int i=0; i<p; i++)
			{
				if(t.h&(1<<i)) continue;
				double tc=t.c+cst[cake[t.p]][cake[i]];
				int th=t.h+(1<<i);
				if(v[i][th]) continue;
				if(tc>L+EPS) continue;
				
				q.push(Trl(i, th, tc));
			}
		}
		cout << (g?"OK":"NA") << endl;
	}
}