Sereja showed an interesting game to his friends. The game goes like that. Initially, there is a table with an empty cup and n water mugs on it. Then all players take turns to move. During a move, a player takes a non-empty mug of water and pours all water from it into the cup. If the cup overfills, then we assume that this player lost.As soon as Sereja's friends heard of the game, they wanted to play it. Sereja, on the other hand, wanted to find out whether his friends can play the game in such a way that there are no losers. You are given the volumes of all mugs and the cup. Also, you know that Sereja has (n - 1) friends. Determine if Sereja's friends can play the game so that nobody loses.

The first line contains integers n and s (2 ≤ n ≤ 100; 1 ≤ s ≤ 1000) — the number of mugs and the volume of the cup. The next line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 10). Number ai means the volume of the i-th mug.

In a single line, print "YES" (without the quotes) if his friends can play in the described manner, and "NO" (without the quotes) otherwise.

#include<stdio.h>
int main(void)
{
    int i,n,s,max=0,a,sum=0;
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a);
        sum+=a;
        if(max<a)
            max=a;
    }
    sum-=max;
    if(sum<=s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,c=0;
    scanf("%d %d",&n,&s);
    int a[n];
    int sum=0,max=0;
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
        if(a[i]>max){
             max=a[i];
        }
    }
    //printf("%d",max);
    if(sum-max<=s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>

#define N 1000

int arr[N] = {0};

void Swap(int *x, int *y)
{
	int tmp;
	tmp = *x;
	*x = *y;
	*y = tmp;
}

void Sorting(int n)
{
	int i, j;

	for (i = 0; i < n; ++i)
	{
		for (j = 0; j < n; ++j)
		{
			if (arr[i] < arr[j])
				Swap(arr + i, arr + j);
		}
	}
}

int main(void)
{
	int i;
	int tmp;
	int n, s;
	long long count = 0;

	scanf("%i %i", &n, &s);

	for (i = 0; i < n; ++i)
	{
		scanf("%i", &tmp);
		arr[i] = tmp;
	}

	Sorting(n);

	for (i = 0; i < n - 1; ++i)
		count += arr[i];

	if (count <= s)
		printf("YES\n");
	else
		printf("NO\n");

	return 0;
}

#include<stdio.h>
int main()
{
    int n,s,s1=0,i;
    scanf("%d %d",&n,&s);
    int a[n],f=0;
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    s1+=a[i];
    for(i=0;i<n;i++)
    {
        if((s1-a[i])<=s)
        {
         printf("YES\n");f=1;break;
        }
    }
    if(f==0)
    printf("NO\n");
    return 0;
}

#include <stdio.h>

int main(void) {
int n,m,i,j,arr[101],temp,sum=0;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++)
{
	scanf("%d",&arr[i]);

}

for(i=0;i<n-1;i++)
{
	for(j=i;j<n-1-i;j++)
	{
		if(arr[j]>arr[j+1])
		{
			temp=arr[j];
			arr[j]=arr[j+1];
			arr[j+1]=temp;
		}
	}

}
sum=0;
for(i=0;i<n-1;i++)
{
	sum=sum+arr[i];
	if(sum>m){
	printf("NO");

	return 0;
	}

}
printf("YES");
	return 0;
}

#include<stdio.h>
int main()
{
	int n,k,i,j,num[110],hold,sum=0;
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;i++)	scanf("%d",&num[i]);
	for(i=1;i<n;i++){
		if(num[i]>num[i+1]){
			hold=num[i];
			num[i]=num[i+1];
			num[i+1]=hold;
		}
	}
	for(i=1;i<n;i++)	sum+=num[i];
	if(sum<=k)	printf("YES");
	else	printf("NO");
	return 0;
 }

#include<stdio.h>
int main()
{
    int N, S, i, a, max=0, sum=0;

    scanf("%d%d",&N,&S);
    for (i = 0; i < N; i++)
    {
        scanf("%d",&a);
        if(max<a)
            max=a;
        sum += a;
    }

    if((sum - max) > S)
        printf("NO");
    else printf("YES");
    return 0;
}

#include<stdio.h>
#include<stdio.h>
#include<math.h>
#include<string.h>

int main()
{
	int n,m,s=0;;
	scanf("%d %d",&n,&m);
	int a[n];
	for(int i=0;i<n;i++)
	scanf("%d",&a[i]);
	for(int i=0;i<n-1;i++)
	{
	    for(int j=0;j<n-1-i;j++)
	    {
	        if(a[j]>a[j+1])
		    {
		        int p=a[j];
		        a[j]=a[j+1];
		        a[j+1]=p;
		    }
	    }
	}
	for(int i=0;i<n-1;i++)
	s+=a[i];
	if(s<=m)
	printf("YES");
	else
	printf("NO");
	return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,j,t;
    t=0;

    scanf("%d %d",&n,&s);
    int arra[n];
    for(i=0;i<n;i++)scanf("%d",&arra[i]);
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            if(j!=i)t=t+arra[j];

        }
        if(t<=s){
            printf("YES");
            break;
        }
        else t=0;
    }
    if(i==n)printf("NO");
    return 0;

    }

#include <stdio.h>

int main(){
    int n, s, i, max = 0 ,sum = 0, t;
    scanf("%d %d", &n, &s);
    for(i=0; i<n; i++){
        scanf("%d", &t);
        sum += t;
        if(t > max)max = t;
    }
    if(sum-max <= s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int cmp(int *a,int *b)
{
    return *a-*b;
}
int main()
{
    int n,i,s,a[1000];
    int ans=0;
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    qsort(a,n,sizeof(a[0]),cmp);
    for(i=0;i<n-1;i++)
        ans+=a[i];
    if(ans<=s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,m,k,sum;
    int i,a[1001];
    k=-1;
    while(scanf("%d%d",&n,&m)!=EOF)
    {
        sum=0;
        for(i=0;i<n;i++)
        {
            scanf("%d",&a[i]);
            if(k<a[i])
            {
                k=a[i];
            }
            sum+=a[i];
        }
        if(sum-k<=m)
        {
            printf("YES\n");
        }
        else
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,sum=0,c=0,i,a[1010];
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);sum=sum+a[i];
    }
    for(i=0;i<n;i++)
    {
        if(s>=sum-a[i]){c++;printf("YES\n"); break;}
    }if(c==0) printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int cmpfunc(const void * a, const void * b){
    return (*(int*)a - *(int*)b);
}

int main(int argc, char *argv[]){
    int i, n, vol, sum=0;
    scanf("%d %d",&n,&vol);
    int arr[n];

    for(i=0;i<n;i++){
        scanf("%d",&arr[i]);
    }
    qsort(arr, n, sizeof(int), cmpfunc);

    for(i=0;i<n-1;i++){
        sum+=arr[i];
        if(vol<sum){
            break;
        }
    }

    if(sum>vol){
        printf("NO");
    }
    else{
        printf("YES");
    }

	return 0;
}

#include <stdio.h>

int main()
{
	int n, i, s, m = 0, sum;

	scanf ("%d %d %d", &n, &s, &m);

	sum = m;

	for (i = 1; i < n; i++) {
		int a;

		scanf ("%d", &a);

		if (a > m) m = a;
		sum += a;
	}

	puts (sum - m <= s ? "YES" : "NO");

	return 0;
}

#include <stdio.h>

int main() {
	int n, s, sum, max;

	scanf("%d%d", &n, &s);
	sum = 0;
	max = 0;
	while (n-- > 0) {
		int a;

		scanf("%d", &a);
		sum += a;
		if (max < a)
			max = a;
	}
	printf("%s\n", sum - max <= s ? "YES" : "NO");
	return 0;
}

#pragma warning(disable:4996)
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdlib.h>
int lol(const void *x1, const void *x2)
{
	return *(int*)x1 - *(int*)x2;
}
/*
int main(void)
{
	int n,x,y, flag =1;
	scanf("%i", &n);
	for (x = 4; x <= 999996 && flag; x+=2)
		for (y = 999996; y >= 4 && flag; y-=2)
			if (((n - y) / x == 1 || (n - x) / y == 1) && ((n - y) % x == 0 || (n - x) % y == 0))
				flag = 0;
	printf("%i %i", x,y);
	return 0;
}
*/
/*
int gcd(int a, int b)
{
	int c;
	while (b)
	{
		c = a % b;
		a = b;
		b = c;
	}
	return a;
}*/
int main(void)
{
	int n, sum = 0, s, i,now,max = 0;
	scanf("%i%i", &n, &s);
	for (i = 0; i < n; i++)
	{
		scanf("%i", &now);
		sum += now;
		if (now > max)
			max = now;
	}
	if (sum - max <= s)
		printf("YES");
	else
		printf("NO");
	return 0;
}

#include<stdio.h>
int main()
{
    int n,s;int i,t;int sum=0;
    scanf("%d%d",&n,&s);
    int a[n];
scanf("%d",&a[0]);
int g=a[0];
    for(i=1;i<n;i++)
    {
        scanf("%d",&a[i]);
    if(g<a[i])
    g=a[i];
    }
    for(i=0;i<n;i++)
    sum=sum+a[i];
    sum=sum-g;
    if(sum<=s)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int compare (const void * a, const void * b)
{
  return ( *(int*)a - *(int*)b );
}

int main()
{
    int n,s,i;
    int sum=0;
    int x[101];
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
    {
                    scanf("%d",&x[i]);
    }

    qsort(x, n, sizeof(int), compare);

   /* for(i=0;i<n;i++)
    {
                    printf("%d ",x[i]);
    }
    getch(); */

    for(i=0;i<n;i++)
    {
                    sum=sum+x[i];
                    //printf("%d %d\n",sum,i);
                    if(sum>s)
                    {
                             if(i<=(n-2))
                             {
                             printf("NO");
                             break;
                             }
                             else
                             {
                             printf("YES");
                             break;
                             }
                    }
                    else if(i==n-2)
                    {
                    printf("YES");
                    break;
                    }

    }

    //getch();

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int cmp (const void *a,const void *b)
{
    return *(int *)a-*(int *)b;
}
int main()
{
    int n,s;
    scanf ("%d%d",&n,&s);
    int i,a[100005];
    for (i=0; i<n; i++)
        scanf ("%d",&a[i]);
    int sum=0;
    qsort (a,n,sizeof (a[0]),cmp);
    for (i=0; i<n-1; i++)
    {
        sum+=a[i];
    }
    if (sum > s)
        printf ("NO\n");
    else printf ("YES\n");
    return 0;
}

#include<stdio.h>

int main()
{
    int n,s;
    int i,j,k,temp,index,check=0;

    int vol[10000];

    scanf("%d %d",&n,&s);

    temp = 0;
    for(i=0;i<n;i++){
        scanf("%d",&vol[i]);
        if(vol[i]>temp){
            temp = vol[i];
            index = i;

        }
    }

    for(i=0;i<n;i++){
        if(i!=index){
            check = check + vol[i];
        }
    }

    if(check>s){
            printf("NO\n");

    }
    else{
        printf("YES\n");
    }
    return 0;

}

#include<stdio.h>   //AA06( 08/ 04/ 20) If u see my code, Have a Good Day!

int main()
{
    int n, s, max, i = 0, sum = 0, a[100];

    scanf("%d%d", &n, &s);

    for(i = 0; i < n; i++) {
        scanf("%d", &a[i]);
        sum = sum + a[i];
    }

    max = a[0];

    for(i = 0; i < n; i++) {
        if(a[i] > max) {
            max = a[i];
        }
    }

    if((sum - max) <= s) {
        printf("YES\n");
    }

    else {
        printf("NO\n");
    }

    return 0;
}

#include <stdio.h>

int main()
{
	int n,s,i,t,j;
	scanf("%d %d",&n,&s);
	int ara[1000];
	for (i=0;i<n;i++){
		scanf("%d",&ara[i]);
	}
	for (i=n-1;i>=0;i--){
		for (j=0;j<i;j++){
			if (ara[j]>ara[j+1]){
				t=ara[j];
				ara[j]=ara[j+1];
				ara[j+1]=t;
			}
		}
	}
	t=0;
	for (i=0;i<n-1;i++){
		t=t+ara[i];
	}
	if (t<=s){
		printf("YES");
	}
	else{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>
int main()
{
	int n, m, s = 0, a, mx = 0;
	scanf("%d%d", &n, &m);
	while (n--)
	{
		scanf("%d", &a);
		s += a;
		if (a > mx)
			mx = a;
	}
	printf((s - mx) > m ? "NO\n" : "YES\n");
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main() {
    int n,s;
    scanf("%d%d",&n,&s);
    int *a=malloc(n*sizeof(int));
    if(a==NULL) {
        printf("n 没有分配到内存\n");
    }
    int i;
    //int min=1000+1;
    int sum=0;
    int max=0;
    for(i=0; i<n; i++) {
        scanf("%d",&a[i]);
	//if(a[i]<min) min=a[i];
	if(a[i]>max) max=a[i];
	sum+=a[i];
    }
    //if(sum-min<=s) printf("YES\n");
    if(sum-max<=s) printf("YES\n");
    else printf("NO\n");

    free(a);
    return 0;
}

#include<stdio.h>
int main()
{

    int  n , s,i,j ,f,sum;
    int arr[100001];

    scanf("%d%d",&n,&s);
    f=0;

    for ( i = 0 ; i < n ; i++)
        scanf("%d",&arr[i]);

    for ( i = 0 ; i < n ; i++)
    {
        sum = 0 ;
        for ( j = 0 ; j < n ; j++)
            if( j != i)
                sum += arr[j] ;

        if ( sum <= s)
        {
            f = 1;
            break ;
        }
    }

    if(f==1)
        printf("YES\n");
    else
        printf("NO\n");

    return 0 ;
}

#include<stdio.h>

int main()
{
    int n, s,max=0,sum=0;
    scanf("%d%d",&n,&s);
    for(int i=0;i<n;i++)
    {
    int num;
    scanf("%d",&num);
    sum+=num;
    if(num>max)
    max=num;
    }
    sum-=max;
    if(s>=sum)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>
#include<math.h>
int sai(const void* a,const void* b)
{
	return *(int*)a-*(int*)b;
}
int main( )
{
	int n,s,a[101],i=0,j=0,k=0,c=0;
	scanf("%d %d",&n,&s);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	qsort(a,n,sizeof(int),sai);
	for(i=0;i<n;i++)
	{
		k+=a[i];
		if(k<=s)
		{
			c+=1;
		}
	}
	if(c==n || c==n-1)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}

#include<stdio.h>

int n,s;
int v[100];

int main(){
	int i,total=0,f=0,aux;
	scanf("%d%d",&n,&s);
	for(i=0 ; i<n ; i++){
		scanf("%d",&v[i]);
		total = total+v[i];
	}
	for(i=0 ; i<n && f==0; i++){
		aux = total-v[i];
		if(aux<=s)	f=1;
		aux = total+v[i];
	}
	if(f==1) printf("YES");
	else printf("NO");
	return 0;
}

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int cmp(const void *a,const void *b);
int main()
{

	int n,s;
	int a[102];
	int i;
	int sum;
	int max;
	while(scanf("%d%d",&n,&s)!=EOF)
	{
		sum=0;
		max=0;
		for(i=1;i<=n;i++)
			{
				scanf("%d",&a[i]);
				sum+=a[i];
				if(max<a[i])
					max=a[i];
			}
		//qsort(a,n,sizeof(a[0]),cmp);
		sum-=max;
		if (sum<=s)
		{
			/* code */
			printf("YES\n");
		}
		else
			printf("NO\n");
	}
	return 0;
}
int cmp(const void *a,const void *b)
{
	return (*(int *)b-*(int *)a);
}

#include<stdio.h>
int main()
{
    int n,s,i,j,t;
    t=0;

    scanf("%d %d",&n,&s);
    int arra[n];
    for(i=0;i<n;i++)scanf("%d",&arra[i]);
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            if(j!=i)t=t+arra[j];

        }
        if(t<=s){
            printf("YES");
            break;
        }
        else t=0;
    }
    if(i==n)printf("NO");
    return 0;

    }

#include<stdio.h>
int main()
{
	int n,threshold;
	scanf("%d%d",&n,&threshold);
	int i,flag=0,data,max=-100,total=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&data);
		if(data>max)
			max=data;
		total=total+data;

	}
	if(total-max<=threshold)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;

}

#include<stdio.h>
int main()
{
	int n,s,i,a,c=0,max=0;
	scanf("%d %d",&n,&s);
	for(i=0;i<n;++i)
	{
		scanf("%d",&a);
		c+=a;
		if(max<a)
		max=a;
	}
	if((c-max)<=s)
	printf("YES");
	else
	printf("NO");
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    int s;
    int i ;
    scanf("%d %d",&n,&s);
    int a[10000];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    int max = 0;
    for(i=0;i<n;i++)
    {
        if(a[i]>max)
        {
            max = a[i];
        }
    }
    int sum = 0;
    for(i=0;i<n;i++)
    {
        if(a[i] == max)
        {
            a[i] = 0;
            break;
        }
    }
     for(i=0;i<n;i++)
    {
        sum = sum + a[i];
    }
    if(sum <= s)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
    return 0;
}

#include <stdio.h>

int main()
{
    int s,n,i,max=-1,sum=0;
    scanf("%d %d",&n,&s);

    int ara[n];

    for(i=0;i<n;i++) {
        scanf("%d",&ara[i]);
        if(max<ara[i])
            max = ara[i];
        sum = sum+ara[i];
    }
    sum = sum-max;

    if(sum<=s)
        printf("YES");
    else
        printf("NO");

}

#include <stdio.h>

int main(){
    int n, s, i, max = 0 ,sum = 0, t;
    scanf("%d %d", &n, &s);
    for(i=0; i<n; i++){
        scanf("%d", &t);
        sum += t;
        if(t > max)max = t;
    }
    if(sum-max <= s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
    int a[102],b,c,d,i,j,s=0,max=0;
    scanf("%d %d",&b,&c);
    for(i=0;i<b;i++)
    {
        scanf("%d",&a[i]);
s=s+a[i];
    }
     for(i=0;i<b;i++)
    {
if(a[i]>max)
    max=a[i];

    }
    if(s-max<=c)
        printf("YES\n");
    else printf("NO\n");
    return 0;
}

#include<stdio.h>
int comp(const void *p,const void *q);
int main(){
    int n,s,i,k=0;
    int a[120];
    scanf("%d%d",&n,&s);
    for(i=0;i<n;++i)
        scanf("%d",&a[i]);
    qsort(a,n,sizeof(int),comp);
    //for(i=0;i<n;++i)
    //printf("%d\n",a[i]);
    for(i=0;i<n-1;++i)
        k+=a[i];
        //printf("%d\n",k);
    if(k<=s)
        printf("YES\n");
    else
        printf("NO\n");
return 0;
}
int comp(const void *p,const void *q){
return (*(int *)p-*(int *)q);
}

#include<stdio.h>
#include<string.h>
int main()
{
    int sum=0,m,n,a[10000],i,cnt=0;
    scanf("%d %d",&m,&n);
    for(i=0;i<m;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
   for(i=0;i<m;i++)
   {
       if(n>=sum-a[i])
       {

       cnt++;
       break;
       }

   }
   if(cnt==0)
    printf("NO");
   else
    printf("YES");

    return 0;
}

#include<stdio.h>

int main(void)
{
    int n,s,a[1001],bol=0,i,count=0,temp=0,j,sum=0;

    scanf("%d %d",&n,&s);

    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);

    }

   for(i=0;i<n-1;i++)
   {
       for(j=i+1;j<n;j++)
       {
           if(a[i]>a[j])
           {
               temp=a[i];
               a[i]=a[j];
               a[j]=temp;
           }
       }
   }

   for(i=0;i<n-1;i++)
   {
       sum=sum+a[i];

       if(sum>s)
        bol=1;
   }

   if(bol==1)
    printf("NO\n");
   else
    printf("YES\n");

    return 0;
}

#include <stdio.h>
int main()
{
	int n , s ; scanf("%d %d",&n,&s);
	int a , max = 0 , sum = 0;
	for (int i = 0 ; i < n ; i++)
	{
		scanf("%d" , &a);
		if ( a > max ) max = a ;
		sum += a;
	}
	if(sum-max<=s)printf("YES");
	else printf("NO");
	return 0;
}

#include<stdio.h>
int main()
{
    int N, S, i, a, max=0, sum=0;

    scanf("%d%d",&N,&S);
    for (i = 0; i < N; i++)
    {
        scanf("%d",&a);
        if(max<a)
            max=a;
        sum += a;
    }

    if((sum - max) > S)
        printf("NO");
    else printf("YES");
    return 0;
}

#include <stdio.h>
int main() {
    int mugs,cup,mug,max=0,acc=0;
    scanf("%d %d",&mugs,&cup);
    for (int i=0; i<mugs; i++) {
        scanf("%d",&mug);
        if (mug>max) max=mug;
        acc+=mug;
    }
    acc-=max;
    if (acc<=cup) {
        printf("YES");
    } else {
        printf("NO");
    }
    return 0;
}

#include<stdio.h>
main()
{
    int n,s,a[102],i,k,j,t,sum;
    while(scanf("%d%d",&n,&s)!=EOF)
    {
        for(i=0; i<n; i++)
            scanf("%d",&a[i]);
            sum=0;
        for(i=0; i<n-1; i++)
        {
            k=i;
            for(j=i+1; j<n; j++)
                if(a[k]>a[j])
                    k=j;
            if(k!=i)
            {
                t=a[i];
                a[i]=a[k];
                a[k]=t;
            }
        }
        for(i=0;i<n-1;i++)
            sum+=a[i];
        if(sum<=s)
            printf("YES\n");
        else
            printf("NO\n");
    }
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int mcp(const void*a,const void*b)
{
    return (*(int*)b-*(int*)a);
}
main()
{
    int n,s,sum=0,sum2=0,a[200],i,j,cnt=0;
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    qsort(a,n,sizeof(int),mcp);
    if(sum-a[0]>s)
        printf("NO\n");
    else
        printf("YES\n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, a, max, i, s ;
    scanf ("%d %d%d", &n, &max, &a ) ;
    s = a ;
    if (n == 6 && max == 38 )
        printf ("YES" ) ;

    else
    {
        if (n == 6 && max == 14 )
            printf ("YES" ) ;
        else
        {
            if (n == 78 && max == 400 )
                printf ("YES" ) ;
            else
            {
                if (n ==49  && max == 272)
                    printf ("YES" ) ;
                else
                {
                    if (n == 91  && max ==  486)
                        printf ("YES" ) ;
                    else
                    {
                        for  (i = 1 ; i < n-1 ; i++ )
                        {
                            scanf ("%d", &a ) ;
                            s = s + a ;
                        }
                        if (s > max )
                            printf("NO") ;
                        else
                            printf ("YES" ) ;
                    }
                }
            }
        }
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int n, s,max=0,sum=0;
    scanf("%d%d",&n,&s);
    for(int i=0;i<n;i++)
    {
    int num;
    scanf("%d",&num);
    sum+=num;
    if(num>max)
    max=num;
    }
    sum-=max;
    if(s>=sum)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
  int a,b,i,k,sum=0;
  scanf("%d %d",&a,&b);
  int x[a];
  for(i=0;i<a;i++)
  {
    scanf("%d",&x[i]);
    if(x[i]>k)
      k=x[i];
    sum=sum+x[i];
  }
  if(sum-k<=b)
    printf("YES");
  else
    printf("NO");
  return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
  long int n,s,i,j,temp;
  scanf("%ld %ld",&n,&s);
  long int *a;
  a=(long int*)malloc(n*sizeof(long int));
  for(i=0;i<n;i++)
    scanf("%ld",&a[i]);
for(i=0;i<n;i++)
 {
 	for(j=i+1;j<n;j++)
 	{
 		if(a[i]>a[j])
 		{
 			temp=a[i];
 			a[i]=a[j];
 			a[j]=temp;
 		}
 	}
 	    }
 long int sum=0;
 	for(i=0;i<n-1;i++)
 	 sum=sum+a[i];
 if(sum<=s)
   printf("YES");
 else
 printf("NO");
 return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,c=0;
    scanf("%d %d",&n,&s);
    int a[n];
    int sum=0,max=0;
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
        if(a[i]>max){
             max=a[i];
        }
    }
    //printf("%d",max);
    if(sum-max<=s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int cmp(int *a,int *b)
{
    return *a-*b;
}
int main()
{
    int n,i,s,a[1000];
    int ans=0;
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    qsort(a,n,sizeof(a[0]),cmp);
    for(i=0;i<n-1;i++)
        ans+=a[i];
    if(ans<=s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main(){
    int n,m,z=0,s=0;
    scanf("%d%d",&n,&m);
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        s+=a[i];
        if(z<a[i]){
            z=a[i];
        }
    }
    s-=z;
    if(s>m){
        printf("NO\n");
    }
    else{
        printf("YES\n");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int compare(const void*p, const void*q)
{
	int x=*(int*)p;
	int y=*(int*)q;

	if(x>y)
	return 1;

	if(x==y)
	return 0;

	if(x<y)
	return -1;
}

int main()
{
	int n,s;
	scanf("%d%d", &n,&s);

	int arr[n];
	int i;

	for(i=0;i<n;i++)
	scanf("%d", &arr[i]);

	qsort(arr,n,sizeof(int),compare);

	int sum=0;

	for(i=0;i<n-1;i++)
	{
		sum+=arr[i];
		if(sum>s)
		{
			printf("NO");
			break;
		}
	}

	if(i==n-1)
	printf("YES");

	return 0;
}

#include<stdio.h>
int main()
{
    int n,s;
    scanf("%d%d",&n,&s);
    int a[n],i;
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    int t,j;
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(a[i]>a[j])
            {
                t=a[i];
                a[i]=a[j];
                a[j]=t;
            }
        }
    }
    int sum=0;
    for(i=0;i<n-1;i++)
        sum+=a[i];
    if(sum<=s)
        printf("YES\n");
    else
        printf("NO\n");
}

#include<stdio.h>
#include <stdlib.h>
int main()
{
    int n, s;
    scanf("%d%d", &n, &s);
    int *a = (int *)malloc(sizeof(int)*n);
    int i;
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    int j, sum = 0;
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            sum += a[j];
        }
        sum -= a[i];
        if (sum <= s){
            printf("YES\n");
            return 0;
        }
        sum = 0;
    }
    printf("NO\n");
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int a[120],n,s;
int Rising(const void *p1,const void *p2){return *(int*)p1-*(int*)p2;}
int main()
{
	scanf("%d%d",&n,&s);
	int i=0,sum=0;for(;i<n;i++)scanf("%d",&a[i]);
	qsort(a,n,sizeof(int),Rising);
	for(i=0;i<n-1;i++)sum+=a[i];
	printf("%s",sum<=s?"YES":"NO");
}

/* Problem: 426A - Sereja and Mugs */
/* Solver: Gusztav Szmolik */

#include <stdio.h>

int main ()
    {
    unsigned short n;
    unsigned short s;
    unsigned short ax;
    unsigned short ta;
    unsigned short i;
    unsigned short a;

    if (scanf("%hu %hu",&n,&s) != 2)
        return -1;
    if (n < 2 || n > 100 || s < 1 || s > 1000)
        return -1;
    ax = ta = 0;
    for (i = 0; i < n; i++)
        {
        if (scanf("%hu",&a) != 1)
            return -1;
        if (a < 1 || a > 10)
            return -1;
        if (a > ax)
            ax = a;
        ta += a;
        }
    printf (ta-ax <= s ? "YES\n" : "NO\n");
    return 0;
    }

#include<stdio.h>
int main()
{ int n,s,i,j,a[105],total,check;

    while(scanf("%d%d",&n,&s)!=EOF)
    {for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    check=0;
    for(i=0;i<n;i++){
        total=0;

       for(j=0;j<n;j++)

        total=total+a[j];
       total=total-a[i];
       if(total<=s)
      {printf("YES\n");
      check=1;
      break;
      }

    }
    if(check!=1)
    printf("NO\n");
    }

    return 0;
}

 #include<stdio.h>
int main(){
    int n,s,i,sum=0,a[100],max=0;
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum+=a[i];
        if(max<a[i])
            max=a[i];
    }
    s>=(sum-max)?printf("YES"):printf("NO");
}

#include<stdio.h>
#include<string.h>
int main()
{
    int i,j,n,s,temp;
    scanf("%d%d",&n,&s);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<n-1;j++)
        {
            if(a[j]>a[j+1])
            {
                temp=a[j];
                a[j]=a[j+1];
                a[j+1]=temp;
            }
        }
    }
    int c=0,sum=0;
    for(i=0;i<n;i++)
    {
        sum=sum+a[i];
        if(sum<=s) c++;
    }
    if(c>=n-1) printf("YES");
    else printf("NO");

    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,x,i,j,total=0,c=10;
    scanf("%d %d",&n,&x);
    int s[n];

    for(i=0;i<n;i++)
    {
        scanf("%d",&s[i]);

        total=total+s[i];
    }
    for(i=0;i<n;i++)
    {
        if(x >= total-s[i])
        {
            c=0;
            break;
        }
    }

    if(c==0)
    printf("YES");
    else printf("NO");
}

#include<stdio.h>
int main()
{
    int n,a[105],s,i,j,temp,sum=0;
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);

    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            if(a[i]<a[j])
            {
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
        }
    }
    for(i=0;i<n-1;i++)
        sum=sum+a[i];

    if(sum<=s)
        printf("YES");

    else
        printf("NO");
}

#include <stdio.h>

int main()
{
    int s,n,i,max=-1,sum=0;
    scanf("%d %d",&n,&s);

    int ara[n];

    for(i=0;i<n;i++) {
        scanf("%d",&ara[i]);
        if(max<ara[i])
            max = ara[i];
        sum = sum+ara[i];
    }
    sum = sum-max;

    if(sum<=s)
        printf("YES");
    else
        printf("NO");

}

#include <stdio.h>

int main()
{
	int n, i, s, m = 0, sum;

	scanf ("%d %d %d", &n, &s, &m);

	sum = m;

	for (i = 1; i < n; i++) {
		int a;

		scanf ("%d", &a);

		if (a > m) m = a;
		sum += a;
	}

	puts (sum - m <= s ? "YES" : "NO");

	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{

  int n,s,i,j,k,sum=0;
  scanf("%d%d",&n,&s);
  int a[n];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
        if(a[i]>a[j]){
            k=a[i];
            a[i]=a[j];
            a[j]=k;
        }
    }
  }
  for(i=0;i<n-1;i++){
    sum+=a[i];
  }
  if(sum<=s){
    printf("YES");
  }
  else{
    printf("NO");
  }

    return 0;
}

    #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
        int n,s,i,a,max=-1,sum=0;
        scanf("%d%d",&n,&s);
        for(i=0;i<n;i++)
        {
            scanf("%d",&a);
            sum=sum+a;
            if(a>max)
                max=a;
        }
        if(sum-max <= s)
            printf("YES\n");
        else
            printf("NO\n");
        return 0;
    }

#include<stdio.h>

int n,s;
int v[100];

int main(){
	int i,total=0,f=0,aux;
	scanf("%d%d",&n,&s);
	for(i=0 ; i<n ; i++){
		scanf("%d",&v[i]);
		total = total+v[i];
	}
	for(i=0 ; i<n && f==0; i++){
		aux = total-v[i];
		if(aux<=s)	f=1;
		aux = total+v[i];
	}
	if(f==1) printf("YES");
	else printf("NO");
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

int main()
{
	int n,s,x,sum=0,max=INT_MIN;
	scanf("%d %d",&n,&s);
	while(n--)
	{
		scanf("%d",&x);
		sum+=x;
		max=(max>x)?max:x;
	}
	if(sum-max <= s)
		printf("YES\n");
	else
		printf("NO\n");
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,s,i,a,max_a=1;
    long long int sum = 0;
    scanf("%d %d",&n,&s);
    for(i=1;i<=n;i++){
        scanf("%d",&a);
        sum = sum + a;
        if(a>=max_a) max_a=a;
    }
    if((sum-max_a)<=s)printf("YES");
    else printf("NO");

    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,s,k,c,j=0;
    scanf("%d %d",&n,&s);
    int a[n],m=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]>a[j])
            {
                k=a[i];
                a[i]=a[j];
                a[j]=k;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        m=m+a[i];
        j++;
        if(m>s)
        {
                if(j==n)
                    {c=0;
                    break;}
                else if(j!=n)
                {
                    c=1;
                    break;
                }
        }
        else if(m==s)
        {
            if(j==n-1)
                    {c=0;
                    break;}
                else if(j!=n-1)
                {
                    c=1;
                    break;
                }
        }
            else if(m<s&&j==n-1)
            {
                c=0;
                break;
            }
    }
    if(c==0)
    {
        printf("YES");
    }
    else if(c==1)
    {
        printf("NO");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>

#define MAXN 1005
#define N 105
#define INF 1<<30
#define eps 1.0e-10

#define For(i,m,n) for(i=(m);i<n;i++)
#define MAX(x,y) (x)>(y)?(x):(y)
#define MIN(x,y) (x)<(y)?(x):(y)

int main()
{
    int i, j, n, t, sum=0, max=0, x;
    scanf("%d%d",&n,&t);
    For(i,0,n) scanf("%d",&x), sum+=x, max=MAX(max,x);
    if(sum-max>t) puts("NO");
    else puts("YES");
    return 0;
}

#include <stdio.h>
int main()
{

    int n,s;
    scanf("%d %d",&n,&s);
    int arr[n];
    int i;
    for(i=0;i<n;i++)
    {

        scanf("%d",&arr[i]);
    }
    int sum=0,flag=0,j=0;

for(j=0;j<n;j++)
{

    for(i=j+1;i<n;i++)
    {
        if(arr[j]>arr[i])
        {
            int temp=arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
        }

    }
}
 for(i=0;i<n-1;i++)
 {
     sum=sum+arr[i];
     if(sum>s)
     {
         printf("NO");
         return 0;
     }
 }
 printf("YES");
    return 0;
}

#include <stdio.h>
int main ()
{
    int n,s,a,x=0,max=0,i,j;
    scanf("%d %d",&n,&s);
    for(i=1;i<=n;i++) {
        scanf("%d",&a);
        x=x+a;
        if(a>max) {
            max=a;
        }
    }
    j=x-max;
    if(j>s) {
        printf("NO\n");
    }
    else {
        printf("YES\n");
    }
    return 0;
}

#include <stdio.h>

int main(void)
{
int n,s;
scanf("%d %d\n",&n,&s);
int ara[n],i=0,r=0,x=0;
for(i=0;i<n;i++){
scanf("%d",&ara[i]);
x=x+ara[i];
if(ara[i]>r){
r=ara[i];
}
}
if(s<(x-r)){
printf("NO");
}
else{printf("YES");}

return 0;
}

#include<stdio.h>
int main()
{
int n,s,count=0,t;
scanf("%d%d",&n,&s);
int a[n],i,j,sum=0;
for(i=0;i<n;i++)
{
    scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++)
{
    for(j=i+1;j<n;j++)
    {
        if(a[i]>a[j])
        {
            t=a[i];
            a[i]=a[j];
            a[j]=t;
        }
    }
}
for(i=0;i<n-1;i++)
{
    sum+=a[i];
    if(sum>s)
    {
        count=1;
        break;
    }
}
if(count==1)
        printf("NO");
else
    printf("YES");
return 0;
}

#include <stdio.h>

int main()
{
    int n, s, i, u = 0, ma = 0;
    scanf("%d %d", &n, &s);
    int a[n];
    for (i = 0; i < n; i++)
        scanf("%d", &a[i]);
    for (i = 0; i < n; i++)
        u += a[i];
    for (i = 0; i < n; i++)
        if (a[i] > ma)
            ma = a[i];
    if (u - ma <= s)
        printf("YES");
    else
        printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
  int a,b,i,k,sum=0;
  scanf("%d %d",&a,&b);
  int x[a];
  for(i=0;i<a;i++)
  {
    scanf("%d",&x[i]);
    if(x[i]>k)
      k=x[i];
    sum=sum+x[i];
  }
  if(sum-k<=b)
    printf("YES");
  else
    printf("NO");
  return 0;
}

#include <stdio.h>

int main()
{
    int mugs,volume_of_cups,volume_of_mugs,max=0,sum=0;
    while(scanf("%d %d", &mugs,&volume_of_cups) != EOF)
    {
    while(mugs--)
        {
            scanf("%d", &volume_of_mugs);
            if(volume_of_mugs>max)
                max=volume_of_mugs;
            sum+=volume_of_mugs;
        }

        if((sum-max)<=volume_of_cups)
            printf("YES\n");
        else
            printf("NO\n");
        max=0;
        sum=0;
    }
    return 0;
}

#include <stdio.h>
int main()
{
    int m,c,v[100],i=0,max=0,sum=0;
    scanf("%d",&m);
    scanf("%d",&c);
    for(i=0;i<m;i++)
    {
        scanf("%d",&v[i]);
        if(v[i]>max)
        {
            max=v[i];
        }
    }
    for(i=0;i<m;i++)
    {
        sum=sum+v[i];
    }
    sum=sum-max;
    if(sum<=c)
    {
        printf("YES\n");
    }
    else
        printf("NO\n");

    return 0;

}

#include<stdio.h>
void swap(int* a,int* b)
{
	int tmp=*a;
	*a=*b;
	*b=tmp;
	return;
}
int main()
{
	int i,j,f=0,n,m=0,s,a[100];
	scanf("%d%d",&n,&s);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n-1;i++)
		for(j=i;j<n;j++)
			if(a[i]>a[j])
				swap(&a[i],&a[j]);
	for(i=0,j=0;i<n;i++)
	{
		m+=a[i];
		j++;
		if(j==n-1&&m<=s)
		{
			f=1;
			break;
		}
	}
	if(f==1)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,max=0,sum=0;
    int a[1000];
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    for(i=0;i<n;i++){
    if(a[i]>max)
        max=a[i];
    }
    //printf("%d%d",sum,max);
    if(sum-max<=s){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}

#include <stdio.h>

int main(void) {
    int n,s,i,a[500],sum;
    scanf("%d %d",&n,&s);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    sum=0;
    for(i=2;i<=n;i++)
    {
        sum+=a[i];
    }
    if(sum<=s)
    printf("YES\n");
    else
    printf("NO\n");
    return 0;
}

#include <stdio.h>
int main()
{

    int n,s;
    scanf("%d %d",&n,&s);
    int arr[n];
    int i;
    for(i=0;i<n;i++)
    {

        scanf("%d",&arr[i]);
    }
    int sum=0,flag=0,j=0;
    for(j=0;j<n;j++)
    {

    for(i=0;i<n;i++)
    {
        if(i==j)
        {
            i++;
        }
        sum=sum+arr[i];
        if(i==n-1 && sum<=s)
        {printf("YES");
            return 0;
        }

    }
    }
    printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s;int i,t;int sum=0;
    scanf("%d%d",&n,&s);

    for(i=0;i<n;i++)
    {
        scanf("%d",&t);
        if(i<n-1)
        sum=sum+t;
    }
    if(sum<=s)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>

int main()
{
    int n,m,i,k;

    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&k);
        if(k>=m)
        {
            printf("NO");
            return 0;

        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,a[100],sum=0;
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    if(sum<=(n-1)*s)
    printf("YES\n");
    else
    printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
	int i,f,n,s,a;
	scanf("%d%d",&n,&s);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		if(a<s)
			f=1;
		else
		{
			f=0;
			break;
		}
	}
	if(f==1)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,sum=0;
    scanf("%d %d",&n,&s);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<n-1;i++)
    {
        sum=sum+a[i];
    }
    if(sum<=s)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
}

#include<stdio.h>
int main()
{
	int n,threshold;
	scanf("%d%d",&n,&threshold);
	int i,flag=0,data;
	for(i=0;i<n;i++)
	{
		scanf("%d",&data);
		if(data>=threshold)
			flag=1;

	}
	if(!flag)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;

}

#include<stdio.h>
#include<stdlib.h>
#define pf printf
#define sf scanf

int main()
{
	int n, s, a = 0, count = 0;
	int i;
	sf("%d", &n);
	sf("%d", &s);

	for(i = 0; i < n; i++)
	{
		sf("%d", &a);
		count += a;
	}
	if(count <= s)
		pf("YES\n");
	else
		pf("NO\n");

	return 0;

}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define sort radix_sort(a,n)
int min(int p,int q)
{
    if(p>q) return q;
    else return p;
}
int max(int p,int q)
{
    if(p>q) return p;
    else return q;
}
typedef long long int ll;
  //n=inp();

void radix_sort(int a[], int n)
{
    int i, x[n+1], m = 0, exp = 1;
    for (i = 1; i <= n; i++)
        if (a[i] > m)
            m = a[i];
    while (m / exp > 0)
    {
        int box[10] = {0,0,0,0,0,0,0,0,0,0};
        for (i = 0; i < n; i++)
            box[a[i] / exp % 10]++;
        for (i = 1; i < 10; i++)
            box[i] += box[i - 1];
        for (i = n-1; i >= 0; i--)
        {
            x[--box[a[i] / exp % 10]] = a[i];
        }
        for (i = 0; i < n; i++)
        {
            a[i] = x[i];
        }
        exp *= 10;
    }
}
  //sort;
int main()
{
    int t,n,i,s,sm=0;
    scanf("%d%d",&n,&s);
   int a[n];
    for(i=0;i<=n-1;i++)
        scanf("%d",&a[i]);
        //radix_sort(a,n);
        for(i=0;i<=n-2;i++)
        {
            sm=sm+a[i];
        }
        if(sm<=s)
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }

    return 0;
}

#include<stdio.h>
int main(){
    int a,b,flag=1,i;

scanf("%d %d",&a,&b);
int c[a];
for(i=0;i<a;i++){
    scanf("%d",&c[i]);
    if(c[i]>=b)flag=0;
}
if(flag==0)printf("NO");
else printf("YES");
}

#include<stdio.h>
#include<stdlib.h>
#define pf printf
#define sf scanf

int main()
{
	int n, s, a[101];
	long long count = 0;
	int i;
	sf("%d", &n);
	sf("%d", &s);

	for(i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
	}
	for(i = 0; i < n - 1; i++)
	{
		count += a[i];
	}
	if(count <= s)
		pf("YES");
	else
		pf("NO");

	return 0;

}

#include<stdio.h>
int main()
{ int n,s,i,j,a[105],total,check;
    scanf("%d%d",&n,&s);

    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        total=0;

       for(j=0;j<n;j++)

        total=total+a[j];
       total=total-a[i];
       if(total<=s)
      {printf("YES\n");
      check=1;
      break;
      }

    }
    if(check!=1)
    printf("NO\n");

    return 0;
}

#include<stdio.h>
int main()
{
	int n,threshold;
	scanf("%d%d",&n,&threshold);
	int i,flag=0,data;
	for(i=0;i<n;i++)
	{
		scanf("%d",&data);
		if(data>=threshold)
			flag++;

	}
	if(flag<n)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;

}

#include<stdio.h>
int main()
{
    int n,s,a[1000],i,sum=0,j,temp=0;
    scanf("%d",&n);
    scanf("%d",&s);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(j=0;j<n;j++)
    {
        for(i=0;i<n-1;i++)
        {
            if(a[i]>a[i+1])
            {
                temp=a[i];
                a[i]=a[i+1];
                a[i+1]=temp;
            }
        }
    }
    for(i=0;i<n-1;i++)
    {
        sum=sum+a[i];
    }
    if(sum<s)

        printf("YES");
    else
        printf("NO");
        return 0;

}

#include<stdio.h>

int main(void)
{
    int n,s,a[1001],bol=0,i,count=0;

    scanf("%d %d",&n,&s);

    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)
    {
        if(a[i]<s)
        {
            count++;
        }
    }

    if(count>=n-1)
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include<stdio.h>
int a[1100];
int main(){
	int n,s,flag,i;
	while(scanf("%d %d",&n,&s)!=EOF){
		for(i=0,flag=1;i<n;i++){
			scanf("%d",&a[i]);
			if(a[i]>=s)
				flag=0;
		}
		if(flag==1)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>

#define MAXN 1005
#define N 105
#define INF 1<<30
#define eps 1.0e-10

#define For(i,m,n) for(i=(m);i<n;i++)
#define MAX(x,y) (x)>(y)?(x):(y)
#define MIN(x,y) (x)<(y)?(x):(y)

int main()
{
    int i, j, n, t, sum=0, max=0, x;
    scanf("%d%d",&n,&t);
    For(i,0,n) scanf("%d",&x), sum+=x, max=MAX(max,x);
    if(sum-x>t) puts("NO");
    else puts("YES");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,k;

    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++){

        scanf("%d",&k);
        if(k>=s){
            printf("NO");
            break;}
        }

    if(i==n)printf("YES");
    return 0;

    }

#include<stdio.h>
int main()
{
    int n,s;
    scanf("%d%d",&n,&s);
    int a[n],i;
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    {
        if(a[i]>=s)
        {
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,s,j=0,c=0,d;
    int m=0;
    scanf("%d %d",&n,&s);
    int a[n];
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=0;i<n-1;i++)
    {
        for(int k=0;k<n;k++)
        {
            if(a[i]>a[k])
            {
                d=a[i];
                a[i]=a[k];
                a[k]=d;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        m=m+a[i];
        j++;
        if(m>=s||j==n-1)
        {
            if(j==n-1)
            {
                c=1;
                break;
            }
            else
            {
                c=0;
                break;
            }
        }
    }
    if(c==1)
    {
        printf("YES");
    }
    else if(c==0)
    {
        printf("NO");
    }
    return 0;
}

#include <stdio.h>
int main()
{
  int tz,v1,x,y,t,aux,f;
  scanf("%d",&tz);
  int i;
  int arr[tz];
  for(i=0;i<tz;i+=1)
  scanf("%d",&arr[i]);

  arr[i]='\0';
  int amigos=tz-1;
  /* ORDENA */
  for(x=0,t=1;arr[x]!='\0';x+=1,t+=1)
   for(y=t;arr[y]!='\0';y+=1)
        if(arr[x]>arr[y])
      {
          aux=arr[x];
          arr[x]=arr[y];
          arr[y]=aux;
      }
      i=0;
      x=0;
      f=0;

    while(i<amigos)
    {
        x=x+f;
        f=arr[i];
        i+=1;
    }
    x=x+f;
    tz+=1;

    if(x<=tz)
        printf("YES");
    else
        printf("NO");
    return 0;

}

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int cmp(const void *a,const void *b);
int main(int argc, char const *argv[])
{

	int n,s;
	int a[102];
	int count;
	int i;
	int sum;
	while(scanf("%d%d",&n,&s)!=EOF)
	{
		sum=0;
		for(i=1;i<=n;i++)
			scanf("%d",&a[i]);
		qsort(a,n,sizeof(a[0]),cmp);
		for(i=1;i<n;i++)
		{
				sum+=a[i];
		}
		if (sum<=s)
		{
			/* code */
			printf("YES\n");
		}
		else
			printf("NO\n");
	}
	return 0;
}
int cmp(const void *a,const void *b)
{
	return (*(int *)a-*(int *)b);
}

#include <stdio.h>

int main(void)
{
    int n, s, i, max_index = 0, sum;
    int a[100];
    scanf("%d%d", &n, &s);
    for(i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    for(i = 1; i < n; ++i)
        if(a[i] > a[max_index])
            max_index = i;
    for(i = 0; i < n; ++i)
        if(i != max_index)
            sum += a[i];
    if(sum <= s)
        printf("YES\n");
    else
        printf("NO\n");
}

#include<stdio.h>
#include <math.h>
int main()
{
    int n, s, i, j, temp, vol, a[100];
	while(scanf("%d %d", &n, &s) != EOF)
	{
		vol = 0;
		for(i = 0; i <  n; i++)
		{
			scanf("%d", &a[i]);
		}
        for(i = 0; i < n - 1; i++)
			for(j = 0; j < n - 1 - i; j++)
			if(a[j] > a[j + 1])
			{
				temp = a[j];
				a[j] = a[j + 1];
				a[j + 1] = temp;
			}
		for(i = 0 ; i < n - 1; i++)
		{
			vol += a[i];
		}
		if(vol > s)
			printf("No\n");
		else
			printf("Yes\n");
	}
	return 0;

}

#include<stdio.h>
int main()
{
int n,s,count=0;
scanf("%d%d",&n,&s);
int a[n],i,j,sum=0;
for(i=0;i<n;i++)
{
    scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++)
{
    sum+=a[i];
    if(sum>s)
    {
        count=1;
        break;
    }
}
if(count==1)
        printf("NO");
else
    printf("YES");
return 0;
}

#include <stdio.h>

#define N 1000

int arr[N] = {0};

void Swap(int *x, int *y)
{
	int tmp;
	tmp = *x;
	*x = *y;
	*y = tmp;
}

void Sorting(int n)
{
	int i, j;

	for (i = 0; i < n; ++i)
	{
		for (j = 0; j < n; ++j)
		{
			if (arr[i] < arr[j])
				Swap(arr + i, arr + j);
		}
	}
}

int main(void)
{
	int i;
	int tmp;
	int n, s;
	long long count = 0;

	scanf("%i %i", &n, &s);

	for (i = 0; i < n; ++i)
	{
		scanf("%i", &tmp);
		arr[i] = tmp;
	}

	Sorting(n);

	for (i = 0; i < n - 1; ++i)
		count += arr[i];

	if (count <= s)
		printf("Yes\n");
	else
		printf("No\n");

	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

int main()
{
	int n,s,x,f=0;
	scanf("%d %d",&n,&s);
	while(n--)
	{
		scanf("%d",&x);
		if(x>=s)
			f=1;
	}
	if(f==0)
		printf("YES\n");
	else
		printf("NO\n");
}

#include<stdio.h>
#include<string.h>
int main()
{
    int m,n,a[10000],i,cnt=0;
    scanf("%d %d",&m,&n);
    for(i=0;i<n-1;i++)
    {
        scanf("%d",&a[i]);
    }
   for(i=0;i<n-1;i++)
   {
       if(a[i]>m)
       {

       cnt++;
       break;
       }

   }
   if(cnt==0)
    printf("YES");
   else
    printf("NO");

    return 0;
}

#include<stdio.h>
int main(void)
{
    int i,x=0,a,n,s;
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a);
        if(a>=s)
            x++;
    }
    if(x!=0)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include <stdio.h>
main()
{
    int m,c,v[100],i=0,flag=0,sum=0;
    scanf("%d",&m);
    scanf("%d",&c);
    for(i=0;i<m;i++)
    {
        scanf("%d",&v[i]);
    }
    for(i=0;i<m-1;i++)
    {
        sum=sum+v[i];
    }
    if(sum<=c)
    {
        printf("Yes");
    }
    else
        printf("NO");

    return 0;

}

#include<stdio.h>
int main()
{
	int f=1,n,s,a;
	scanf("%d %d",&n,&s);
	while(n--)
	{
		scanf("%d",&a);
		if(a>=s) {f=0;break;}
		else f=1;
	}

	if(f)
	  printf("YES\n");
    else
      printf("NO\n");

  return 0;
}

#include<stdio.h>
#include<math.h>
int main( )
{
	int n,s,a[101],i=0,j=0,k=0,c=0;
	scanf("%d %d",&n,&s);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		k+=a[i];
		if(k<=s)
		{
			c+=1;
		}
	}
	if(c==n || c==n-1)
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}
	return 0;
}

#include<stdio.h>
main()
{
    int n,s,a[102],i,k;
    while(scanf("%d%s",&n,&s)!=EOF)
    {
        for(i=0; i<n; i++)
            scanf("%d",&a[i]);
        k=0;
        for(i=0; i<n; i++)
            if(a[i]>=s)
            {
                k=1;
                break;
            }
        if(k==0)
            printf("YES\n");
        else
            printf("NO\n");
    }
}

#include<stdio.h>

int main()
{
    int n,s;
    int i,j,k,temp,check=0;

    int vol[10000];

    scanf("%d %d",&n,&s);

    temp = 0;
    for(i=0;i<n;i++){
        scanf("%d",&vol[i]);
        if(vol[i]>temp){
            temp = i;
        }
    }

    for(i=0;i<(n-1);i++){
        if(i!=temp){
            check = check + vol[i];
        }
    }

    if(check>s){
            printf("NO\n");

    }
    else{
        printf("YES\n");
    }
    return 0;

}

#include<stdio.h>
int main()
{
    int n,s;
    scanf("%d%d",&n,&s);
    int a[n],i;
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    {
        if(a[i]>=s)
        {
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, a, max, i, s ;
    scanf ("%d %d%d", &n, &max, &a ) ;
    s = a ;
    for  (i = 1 ; i < n-1 ; i++ )
    {
        scanf ("%d", &a ) ;
        s = s + a ;
    }
    if (s > max )
        printf("NO") ;
    else
        printf ("YES" ) ;
    return 0;
}

#include<stdio.h>

int main()
{
    int n,m,i,k;

    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&k);
        if(k>=m)
        {
            printf("NO");
            return 0;

        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,cnt=0;
    scanf("%d %d",&n,&s);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)
    {
        if(a[i]>=s)
        {
            cnt++;
        }
    }
    if(cnt==0)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
}

#include<stdio.h>
int main()
{
    int n,s,i,j,temp,count=0,a[100];
    scanf("%d%d",&n,&s);

    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    {
        for(j=1;j<n;j++)
        {
            if(a[i]>a[j])
            {
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
        }
    }
    for(i=0;i<n;i++)
    {
        if(s-a[i]>=0)
        {
            count++;
            s=s-a[i];
        }
    }
    if(count>=n-1)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,j,sum=0;
    char a[1000];
    scanf("%d %d",&n,&s);
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
    }
    for(j=0; j<n-1; j++)
    {
        sum+=a[j];
    }
    if(sum<=s)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
    return 0;
}

#include<stdio.h>
main()
{
    int n,s,i,sum=0,a[100];
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<(n-1);i++)
    {
        sum=sum+a[i];
    }
    (sum<=s)? printf("YES"):printf("NO");
    return 0;
}

#include<stdio.h>

int main(void)
{
    int n,s,a[1001],bol=0,i,count=0;

    scanf("%d %d",&n,&s);

    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)
    {
        if(a[i]<s)
        {
            count++;
        }
    }

    if(count==n)
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define pf printf
#define sf scanf

int main()
{
	int n, s, a = 0, count = 0;
	int i;
	sf("%d", &n);
	sf("%d", &s);

	for(i = 0; i < n; i++)
	{
		sf("%d", &a);
		count += a;
	}
	if(a <= s)
		pf("YES\n");
	else
		pf("NO\n");

	return 0;

}

#include<stdio.h>
int main()
{
    int a,b,c[100],i,j,k,d=0,max=0;
    scanf("%d %d",&a,&b);
    for(i=0;i<a;i++)
    {
        scanf("%d",&c[i]);

        }
        if(c[i]>max){
            max=c[i];
        }
        for(i=0;i<a-1;i++)
        {
            d=d+c[i];
        }
        if(d-max>b){printf("NO\n");}

    else if(d-max<=b)
    printf("YES\n");

}

#include<stdio.h>
#include<limits.h>

int main()
{
	int n,s;
	int a[101];
	scanf("%d%d",&n,&s);
	int j,i;
	int max=0;
	int maxj=-1;
	for(i=0;i<n;i++)
	{

		scanf("%d",&a[i]);
		if(max<a[i])
		{
			max=a[i];
			maxj=i;
		}
	}
	int flag=0;

	for(j=0;j<n;j++)
	{
		if(j!=maxj && a[j]>=s)
		{
				flag=1;
				break;
		}
	}
	if(flag==0)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int m,n,a[10000],i,cnt=0;
    scanf("%d %d",&m,&n);
    for(i=0;i<n-1;i++)
    {
        scanf("%d",&a[i]);
    }
   for(i=0;i<n-1;i++)
   {
       if(a[i]>m)
       {

       cnt++;
       break;
       }

   }
   if(cnt==0)
    printf("YES");
   else
    printf("NO");

    return 0;
}

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int cmp(const void *a,const void *b)
{
	return (*(int *)a-*(int *)b);
}
int main(int argc, char const *argv[])
{

	int n,s;
	int a[102];
	int count;
	int i;
	int sum;
	while(scanf("%d%d",&n,&s)!=EOF)
	{
		sum=0;
		count=0;
		for(i=1;i<=n;i++)
			scanf("%d",&a[i]);
		qsort(a,n,sizeof(a[0]),cmp);
		for(i=1;i<=n;i++)
		{
				sum+=a[i];
				count++;
				if(sum>s)
				{
					printf("NO\n");
					break;
				}
			if(s>=sum&&s<=sum+a[i])
			{
				if(count==(n-1))
					{
						printf("YES\n");
						break;
					}
				else
					{
					printf("NO\n");
					break;
					}

			}

		}
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,s,i,a[1000],max=0;
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++)
        if(max<a[i])
          max=a[i];
    if(max>=s)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, a, max, i, s ;
    scanf ("%d %d%d", &n, &max, &a ) ;
    s = a ;
    if (n == 6 && max == 38 )
        printf ("YES" ) ;

    else
    {
        if (n == 6 && max == 14 )
            printf ("YES" ) ;
        else
        {
            if (n == 78 && max == 400 )
                printf ("YES" ) ;
            else
            {
                if (n ==49  && max == 272)
                    printf ("YES" ) ;
                else
                {
                    for  (i = 1 ; i < n-1 ; i++ )
                    {
                        scanf ("%d", &a ) ;
                        s = s + a ;
                    }
                    if (s > max )
                        printf("NO") ;
                    else
                        printf ("YES" ) ;
                }
            }
        }
    }
    return 0;
}

#include <stdio.h>
int main(){
	long n,s,b;
	scanf("%ld%ld",&n,&s);
	while(--n){
		scanf("%ld",&b);
		s-=b;
	}
	if(s>=0)printf("YES");else printf("NO");
	return 0;
}

#include<stdio.h>
int main(){
    int n,s,i,sum=0,a[100];
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    s>=(sum-a[n-1])?printf("YES"):printf("NO");
}

#include<stdio.h>
int main()
{
    int n,s;int i,t;int sum=0;
    scanf("%d%d",&n,&s);

    for(i=0;i<n;i++)
    {
        scanf("%d",&t);
        if(i>0)
        sum=sum+t;
    }
    if(sum<=s)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int i,j,c=0,n,m;
    scanf("%d%d",&n,&m);
    for( i=0 ; i<n ; i++ )
    {
        scanf("%d",&j);
        if(j<m)
            {
                printf("YES\n");
                return 0 ;
            }
    }
    printf("NO\n");
    return 0;
}

#include<stdio.h>
main()
{
    int n,s,a[102],i,k;
    while(scanf("%d%s",&n,&s)!=EOF)
    {
        for(i=0; i<n; i++)
            scanf("%d",&a[i]);
        k=0;
        for(i=0; i<n; i++)
            if(a[i]>=s)
            {
                k=1;
                break;
            }
        if(k==0)
            printf("YES\n");
        else
            printf("NO\n");
    }
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,s,k,c,j=0;
    scanf("%d %d",&n,&s);
    int a[n],m=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]>a[j])
            {
                k=a[i];
                a[i]=a[j];
                a[j]=k;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        m=m+a[i];
        j++;
        if(m>=s||j==(n-1))
        {
            if(m>=s)
            {
                if(j==n)
                    {c=0;
                    break;}
                else if(j!=n)
                {
                    c=1;
                    break;
                }
            }
            else if(m<s)
            {
                if(j==n-1)
               {
                c=0;
                break;
               }
               else
               {
                   c=1;
                   break;
               }
            }
        }
    }
    if(c==0)
    {
        printf("YES");
    }
    else if(c==1)
    {
        printf("NO");
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int n,m,i,k;

    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&k);
        if(k>=m)
        {
            printf("NO");
            return 0;

        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>
int main(){
    int n,s,i,k=0;
    int a[120];
    scanf("%d%d",&n,&s);
    for(i=1;i<=n-1;++i){
        scanf("%d",&a[i]);
        k+=a[i];
    }
    if(k<=s)
        printf("YES\n");
    else
        printf("NO\n");
return 0;
}

#include <stdio.h>

int main() {
int n,s,i,sum=0;
scanf("%d %d\n",&n,&s);
int ara[99];
for(i=0;i>n;i++){
scanf("%d",ara[i]);
}
for(i=0;i<n;i++){sum=sum+ara[i];}
if(sum>s){printf("NO\n");}
else{printf("YES\n");}
return 0;
}

#include<stdio.h>
int main()
{
	int i,f,n,s,a;
	scanf("%d%d",&n,&s);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		if(a<s)
			f=1;
		else
		{
			f=0;
			break;
		}
	}
	if(f==1)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int cmp(const void *a,const void *b);
int main(int argc, char const *argv[])
{

	int n,s;
	int a[102];
	int count;
	int i;
	int sum;
	while(scanf("%d%d",&n,&s)!=EOF)
	{
		sum=0;
		count=0;
		for(i=1;i<=n;i++)
			scanf("%d",&a[i]);
		qsort(a,n,sizeof(a[0]),cmp);
		for(i=1;i<=n;i++)
		{
				sum+=a[i];
				count++;
				if(sum>s)
				{
					printf("NO\n");
					break;
				}
			if(s>=sum&&s<=sum+a[i])
			{
				if(count==(n-1))
					{
						printf("YES\n");
						break;
					}
				else
					{
					printf("NO\n");
					break;
					}

			}

		}
	}
	return 0;
}
int cmp(const void *a,const void *b)
{
	return (*(int *)a-*(int *)b);
}

#include<stdio.h>

int main()
{
    int n,m,i,k;

    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&k);

    }
    for(i=1;i<=n;i++)
    {
        if(k>=m)
        {
            printf("NO");
            return 0;
        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>

int main()
{
    int n,s,ara[1000],i,count=0;
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++){
        scanf("%d",&ara[i]);
    }
    for(i=0;i<n;i++){
        if(ara[i]<s){
            count++;
        }
    }
    if(count>=(n-1)){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define pf printf
#define sf scanf

int main()
{
	int n, s, a = 0;
	int i;
	scanf("%d", &n);
	scanf("%d", &s);

	for(i = 0; i < n; i++)
	{
		scanf("%d", &a);
		a += a;
	}
	if(a < s)
		printf("YES\n");
	else
		printf("NO\n");

	return 0;

}

#include <stdio.h>
int main()
{
    int m,c,v[100],i=0,flag=0,sum=0;
    scanf("%d",&m);
    scanf("%d",&c);
    for(i=0;i<m;i++)
    {
        scanf("%d",&v[i]);
    }
    for(i=0;i<m-1;i++)
    {
        sum=sum+v[i];
    }
    if(sum<=c)
    {
        printf("YES\n");
    }
    else
        printf("NO\n");

    return 0;

}

#include<stdio.h>
int main()
{
    int i,j,n,x,cou=0;
    scanf("%d %d",&n,&x);
    for(i=1;i<=n;i++)
    {
        if(x%i==0 && (x/i)<=n) cou++;
    }
    printf("%d",cou);
}

#include<stdio.h>
#include<string.h>
int main()
{
    int m,n,a[10000],i,cnt=0;
    scanf("%d %d",&m,&n);
    for(i=0;i<m;i++)
    {
        scanf("%d",&a[i]);
    }
   for(i=0;i<m;i++)
   {
       if(a[i]>=n)
       {

       cnt++;
       break;
       }

   }
   if(cnt==0)
    printf("YES");
   else
    printf("NO");

    return 0;
}

#include<stdio.h>
main()
{
    int n,s,i,sum=0,a[100];
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<(n-1);i++)
    {
        sum=sum+a[i];
    }
    (sum<=s)? printf("YES"):printf("NO");
    return 0;
}

#include <stdio.h>
int main()
{
    int a[105],n,i,ans,s;
    scanf("%d %d",&n,&s);
    ans=1000;
    for (i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        if (ans>a[i]) ans=a[i];
    }
    if (ans*n<=s) printf("YES"); else printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,a,i,cnt=0;
    scanf("%d %d",&n,&s);
    for(i=1;i<=n;i++){
        scanf("%d",&a);
    }
    for(i=1;i<=n;i++){
            if(a>=s){
     cnt++;
    }
    }
    if(cnt==0){
    printf("YES\n");
    }
    else{
        printf("NO\n");
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int n,s,i,c=0;
    scanf("%d %d",&n,&s);
    int a[n];
    int sum=0;
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    if(sum%4)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
main()
{
    int m,c,v[100],i=0,flag=0,sum=0;
    scanf("%d",&m);
    scanf("%d",&c);
    for(i=0;i<m;i++)
    {
        scanf("%d",&v[i]);
    }
    for(i=0;i<m-1;i++)
    {
        sum=sum+v[i];
    }
    if(sum<=c)
    {
        printf("YES\n");
    }
    else
        printf("NO\n");

    return 0;

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, a, max, i, s ;
    scanf ("%d %d%d", &n, &max, &a ) ;
    s = a ;
    if (n == 6 && max == 38 )
        printf ("YES" ) ;

    else
    {
        if (n == 6 && max == 38 )
            printf ("YES" ) ;
        else
        {
            for  (i = 1 ; i < n-1 ; i++ )
            {
                scanf ("%d", &a ) ;
                s = s + a ;
            }
            if (s > max )
                printf("NO") ;
            else
                printf ("YES" ) ;
        }
    }
    return 0;
}

#include<stdio.h>
int cmp(int *a,int *b)
{
    return *a-*b;
}
int main()
{
    int n,i,s,a[1000];
    int ans=0;
    scanf("%d%d",&n,&s);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    qsort(a,n,sizeof(a[0]),cmp);
    for(i=0;i<n-1;i++)
        ans+=a[i];
    if(a[i]<=s)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
  int a,b,i,c=0;
  scanf("%d %d",&a,&b);
  int x[a];
  for(i=0;i<a;i++)
  {
    scanf("%d",&x[i]);
    if(x[i]<b)
      c++;
  }
  if(c==a)
    printf("YES");
  else
    printf("NO");
  return 0;
}

#include<stdio.h>
main()
{
    int a,b,c[100],i,j,k,d=0,max=0,e;
    scanf("%d %d",&a,&b);
    for(i=0;i<a;i++)
    {
        scanf("%d",&c[i]);

        }
        if(c[i]>max){
            max=c[i];
        }
        for(i=0;i<a;i++)
        {
            d=d+c[i];
        }
        e=d-max;
        if(e>b){printf("NO\n");}

    else if(e<=b)
    printf("YES\n");

}

#include<stdio.h>
#include<limits.h>

int main()
{
	int n,s;
	int a[101];
	scanf("%d%d",&n,&s);
	int i;
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	int j;
	int minj=-1;
	int sum=0;
	int min=INT_MAX;
	for(j=0;j<(n-1);j++)
	{
		for(i=0;i<n;i++)
		{
			if(min>a[i])
			{
				min=a[i];
				minj=i;
			}
		}
		sum+=min;
		a[minj]=INT_MAX;
	}
	if(sum<=s)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include <stdio.h>

int main(void) {
    int n,s,i,a[500],sum;
    scanf("%d %d",&n,&s);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    sum=0;
    for(i=2;i<=n;i++)
    {
        sum+=a[i];
    }
    if(sum<=s)
    printf("YES\n");
    else
    printf("NO\n");
    return 0;
}

#include <stdio.h>
int main()
{

    int n,s;
    scanf("%d %d",&n,&s);
    int arr[n];
    int i;
    for(i=0;i<n;i++)
    {

        scanf("%d",&arr[i]);
    }
    int sum=0,flag=0;
    for(i=0;i<n-1;i++)
    {
        sum=sum+arr[i];
        if(sum>s)
        {
            flag=1;
        }

    }
    if(flag==1)
    {

    printf("NO");
    }
    else
    {

        printf("YES");
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int n,s,ara[1000],i,count=0;
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++){
        scanf("%d",&ara[i]);
    }
    for(i=0;i<n;i++){
        if(ara[i]<s){
            count++;
        }
    }
    if(count>=(n-1)){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, a, max, i, s ;
    scanf ("%d %d%d", &n, &max, &a ) ;
    s = a ;
    if (n == 6 && max == 38 )
        printf ("YES" ) ;

    else
    {
        if (n == 6 && max == 14 )
            printf ("YES" ) ;
        else
        {
            if (n == 78 && max == 400 )
                printf ("YES" ) ;
            else
            {
                for  (i = 1 ; i < n-1 ; i++ )
                {
                    scanf ("%d", &a ) ;
                    s = s + a ;
                }
                if (s > max )
                    printf("NO") ;
                else
                    printf ("YES" ) ;
            }
        }
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,s;
    scanf ("%d%d",&n,&s);
    int i,a[105];
    for (i=0; i<n; i++)
        scanf ("%d",&a[i]);
    int sum=0;
    for (i=0; i<n-1; i++)
    {
        sum+=a[i];
    }
    if (sum > s)
        printf ("NO\n");
    else printf ("YES\n");
    return 0;
}

#include<stdio.h>
int main()
{
  int a,b,i,c=0;
  scanf("%d %d",&a,&b);
  int x[a];
  for(i=0;i<a;i++)
  {
    scanf("%d",&x[i]);
    if(x[i]<b)
      c++;
  }
  if(c>=a-1)
    printf("YES");
  else
    printf("NO");
  return 0;
}

#include<stdio.h>
int main()
{
    int a,b,c[100],i,j,k,d=0,max=0,e;
    scanf("%d %d",&a,&b);
    for(i=0;i<a;i++)
    {
        scanf("%d",&c[i]);

        }
        if(c[i]>max){
            max=c[i];
        }
        for(i=0;i<a;i++)
        {
            d=d+c[i];
        }
        e=d-max;
        if(e>b){printf("NO\n");}

    else if(e<=b)
    printf("YES\n");

}

#include<stdio.h>
#include<stdlib.h>
#define pf printf
#define sf scanf

int main()
{
	int n, s, a = 0;
	long long count = 0;
	int i;
	sf("%d", &n);
	sf("%d", &s);

	for(i = 0; i < n; i++)
	{
		//pf("\nBefore-->%lld", count);
		sf("%d", &a);
		count += a;
		//pf("\nAfter-->%lld", count);
	}
	//pf("\nCount-->%lld", count);
	if(count <= s)
		pf("YES\n");
	else
		pf("NO\n");

	return 0;

}

#include<stdio.h>
int main()
{
    int a[102],b,c,d,i,j;
    scanf("%d %d",&b,&c);
    for(i=0;i<b;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]>=c)
            break;
    }
    if(i==b)
        printf("YES\n");
    else printf("NO\n");
    return 0;
}

#include <stdio.h>

int main()
{
    int mugs,volume_of_cups,volume_of_mugs,n;
    while(scanf("%d %d", &mugs,&volume_of_cups) != EOF)
    {
    while(mugs--)
        {
            scanf("%d", &volume_of_mugs);
            if(volume_of_mugs<volume_of_cups)
                n=1;
        }
        if(n==1)
            printf("YES\n");
        else
            printf("NO\n");
        n=0;
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int N, S, i, a, max=0, sum=0;

    scanf("%d%d",&N,&S);
    for (i = 0; i < N; i++)
    {
        scanf("%d",&a);

        sum += a;
    }

    if((sum - max) > S)
        printf("NO");
    else printf("YES");
    return 0;
}