#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#define S(x) ((x)*(x))
int main()
{
	int m,n,a[13],i;
	char*p,*q,s[64];
	while(fgets(s,64,stdin))
	{
		m=strtol(s,&p,10);
		for(n=0;a[n]=strtol(p,&q,10),p!=q;++n)p=q;
		if(!n)continue;
		std::sort(a,a+n);
		do
		{
			double d=a[0]+a[n-1];
			for(i=0;i<n;++i)d+=sqrt((double)S(a[i]+a[i+1])-S(a[i]-a[i+1]));
			if(m>=d){puts("YES");goto E;}
		}while(std::next_permutation(a,a+n));
		puts("NO");
E:;
	}
	return 0;
}