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.


-----Input-----

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 a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10). Number a_{i} means the volume of the i-th mug.


-----Output-----

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


-----Examples-----
Input
3 4
1 1 1

Output
YES

Input
3 4
3 1 3

Output
YES

Input
3 4
4 4 4

Output
NO

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
(n, s) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
print('YES' if sum(a) - max(a) <= s else 'NO')


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
print(['NO', 'YES'][sum(l) - max(l) <= m])


(num_mugs, cup_volume) = map(int, input().split(' '))
mug_volumes = list(map(int, input().split(' ')))
if sum(mug_volumes) - max(mug_volumes) <= cup_volume:
	print('YES')
else:
	print('NO')


import math
(n, s) = str(input()).split()
n = int(n)
s = int(s)
line = str(input()).split()
line = [int(it) for it in line]
line.sort()
if sum(line[:n - 1]) > s:
	print('NO')
else:
	print('YES')


(n, s) = list(map(int, input().split()))
a = list(map(int, input().split()))
a.remove(max(a))
ans = sum(a) > s
print('NO' if ans else 'YES')


def readToInt():
	return [int(n) for n in input().split()]
line = readToInt()
(n, s) = (line[0], line[1])
nums = readToInt()
if sum(nums) - max(nums) <= s:
	print('YES')
else:
	print('NO')


a = input().split()
(n, s) = (int(a[0]), int(a[1]))
a = input().split()
a.sort()
sum = 0
for i in range(n - 1):
	sum += int(a[i])
if sum <= s:
	print('YES')
else:
	print('NO')


(n, s) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
su = 0
m = a[0]
for i in a:
	if i > m:
		m = i
	su += i
if su - m <= s:
	print('YES')
else:
	print('NO')


string = input().split(' ')
n = int(string[0])
s = int(string[1])
mug = input().split(' ')
for i in range(n):
	mug[i] = int(mug[i])
mug = sorted(mug)[:n - 1]
if sum(mug) > s:
	print('NO')
else:
	print('YES')


(n, k) = [int(i) for i in input().split()]
arr = [int(i) for i in input().split()]
temp = sum(arr)
if all(map(lambda x: temp - x > k, arr)):
	print('NO')
else:
	print('YES')


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
if sum(l[0:n - 1]) <= k:
	print('YES')
else:
	print('NO')


from collections import defaultdict, deque, Counter, OrderedDict
import threading, sys

def main():
	(n, m) = map(int, input().split())
	a = [int(i) for i in input().split()]
	v = sum(a) - max(a)
	print('YES' if v <= m else 'NO')
main()


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if s >= sum(a) - a[-1]:
	print('YES')
else:
	print('NO')


def main():
	[n, s] = [int(_) for _ in input().split()]
	volumn_mugs = [int(_) for _ in input().split()]
	max_mug = max(volumn_mugs)
	sum_mug = sum(volumn_mugs)
	print('YES' if sum_mug - max_mug <= s else 'NO')
main()


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.pop(-1)
if sum(l) > s:
	print('NO')
else:
	print('YES')


import re
import inspect
from sys import argv, exit

def rstr():
	return input()

def rint():
	return int(input())

def rints(splitchar=' '):
	return [int(i) for i in input().split(splitchar)]

def varnames(obj, namespace=globals()):
	return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
	prnt(varnames(var), var)

def prnt(*args, override=False):
	if '-v' in argv or override:
		print(*args)
(n, cup) = rints()
mugs = rints()
mugs.remove(max(mugs))
if cup >= sum(mugs):
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
lis = [int(i) for i in input().split()]
sums = sum(lis)
ma = max(lis)
if sums - ma <= s:
	print('YES')
else:
	print('NO')


import fileinput

def test():
	pass
num_args = 2
total_volume = 0
for arg in range(num_args):
	if arg == 0:
		(n, s) = map(int, input().split())
	else:
		a = input().split()
a.remove(max(a))
for i in range(len(a)):
	total_volume += int(a[i])
	if total_volume > s:
		print('NO')
		break
if total_volume <= s:
	print('YES')


import sys
import math
(n, s) = [int(x) for x in sys.stdin.readline().split()]
an = [int(x) for x in sys.stdin.readline().split()]
vmax = 0
vsum = 0
for i in an:
	if i > vmax:
		vmax = i
	vsum += i
if vsum - vmax <= s:
	print('YES')
else:
	print('NO')


import sys
(n, m) = map(int, input().split())
k = [int(i) for i in input().split()]
if sum(k) - max(k) > m:
	print('NO\n')
else:
	print('YES\n')


(n, v) = map(int, input().split())
cups = sorted(list(map(int, input().split())))
tot = 0
for i in range(n - 1):
	tot += cups[i]
if 0 <= v - tot <= v:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
upper = max(a)
su = sum(a)
if su - upper <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
S = sum(a)
if S - max(a) <= s:
	print('YES')
else:
	print('NO')


(num_mugs, cup_volume) = map(int, input().split(' '))
mug_volumes = sorted(list(map(int, input().split(' '))))
possible = True
for i in range(num_mugs - 1):
	cup_volume -= mug_volumes[i]
	if cup_volume < 0:
		possible = False
		break
if possible:
	print('YES')
else:
	print('NO')


final_sum = 0
max_volue = 0
(amount_cups, volume) = map(int, input().split())
volue = list(map(int, input().split()))
for i in range(amount_cups):
	if volue[i] > max_volue:
		index_max_volue = i
		max_volue = volue[i]
volue.pop(index_max_volue)
for i in range(len(volue)):
	final_sum += volue[i]
if final_sum > volume:
	print('NO')
else:
	print('YES')


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
	ans += l[i]
if ans - max(l) <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split(' '))
v = list(map(int, input().split(' ')))
print('NO') if sum(v) - max(v) > s else print('YES')


(n, s) = map(int, input().split())
kru = list(map(int, input().split()))
max = 0
sum = 0
for i in range(n):
	sum += kru[i]
	if kru[i] >= max:
		max = kru[i]
answer = 'YES'
if sum - max > s:
	answer = 'NO'
print(answer)


def main():
	(n, s) = map(int, input().split())
	aa = list(map(int, input().split()))
	print(('NO', 'YES')[sum(aa) <= s + max(aa)])
main()


(n, s) = list(map(int, input().split()))
m = sorted(list(map(int, input().split())))
of = 0
for i in range(n):
	of += m[i]
	if of > s and i + 1 <= n - 1:
		print('NO')
		exit()
print('YES')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
(M, S) = (max(a), sum(a))
ans = 'NO'
if S - M <= s:
	ans = 'YES'
print(ans)


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
m = 0
c = 0
for i in range(n):
	c += l[i]
	if l[i] > m:
		m = l[i]
if c - m <= s:
	print('YES')
else:
	print('NO')


(a, b) = input().split()
l = list(map(int, input().split()))
x = len(l)
v = max(l)
w = sum(l) - v
if w <= int(b):
	print('YES')
else:
	print('NO')


(n, h) = map(int, input().split())
l = sorted(map(int, input().split()))
if sum(l[:-1]) > h:
	print('NO')
else:
	print('YES')


(n, s) = map(int, input().split(' '))
L = sorted([int(x) for x in input().split()])
ss = sum(L) - L[n - 1]
if ss <= s:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
if sum(a[:n - 1]) > m:
	print('NO')
else:
	print('YES')


print((lambda x, a: 'YES' if sum(sorted(a)[:x[0] - 1]) <= x[1] else 'NO')(list(list(map(int, input().split()))), list(map(int, input().split()))))


string = input()
numbers = string.split()
(a, b) = (int(numbers[0]), int(numbers[1]))
string = input()
numbers = list(map(int, string.split()))
if sum(numbers) - max(numbers) <= b:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)
if sum(a[:len(a) - 1]) <= s:
	print('YES')
else:
	print('NO')


(mugs, cups) = map(int, input().split(' '))
volume = list(map(int, input().split(' ')))
volume.sort()
sum1 = 0
for i in range(mugs - 1):
	sum1 = sum1 + volume[i]
if sum1 <= cups:
	print('YES')
else:
	print('NO')


(a, b) = map(int, input().split())
x = [int(i) for i in input().split()]
if sum(x) - max(x) <= b:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
l = [*map(int, input().split())]
if sum(l) - max(l) <= s:
	print('YES')
else:
	print('NO')


(no_of_mugs, cup_volume) = map(int, input().split(' '))
vol_mugs = list(map(int, input().split(' ')))
vol_mugs.sort()
if sum(vol_mugs[:-1]) <= cup_volume:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = [int(i) for i in input().split()]
summa = 0
for i in a:
	summa += i
summa -= max(a)
if s < summa:
	print('NO')
else:
	print('YES')


(n, s) = map(int, input().split())
list = [int(i) for i in input().split()]
list[list.index(max(list))] = 0
for i in range(n):
	if list[i] > s:
		print('NO')
		exit()
	else:
		s -= list[i]
print('YES')


(n, s) = map(int, input().split())
l = [int(i) for i in input().split()]
s1 = 0
for i in range(n - 1):
	s1 += min(l)
	l.remove(min(l))
if s1 <= s:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
a.remove(max(a))
if sum(a) > m:
	print('NO')
else:
	print('YES')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(n - 1):
	c = c + a[i]
if c <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
p = sum(arr[:n - 1])
if p > s:
	print('NO')
else:
	print('YES')


def can_win_all(cups, bowl):
	sum_cups = sum(cups)
	max_cup = max(cups)
	if sum_cups - max_cup <= bowl:
		return 'YES'
	else:
		return 'NO'
(cups_len, bowl) = map(int, input().split(' '))
cups = list(map(int, input().split(' ')))
print(can_win_all(cups, bowl))


(a, b) = input().split()
mugs = input().split()
sortedMugs = sorted(mugs)
total = 0
for i in range(int(a) - 1):
	total += int(sortedMugs[i])
if total > int(b):
	print('NO')
else:
	print('YES')


(n, s) = list(map(int, input().split()))
a = [i for i in map(int, input().split())]
r = ['NO', 'YES']
z = sum(a) - max(a) <= s
print(r[z])


(n, s) = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
maxofa = max(a)
sumofa = sum(a)
if sumofa - maxofa <= s:
	print('YES')
else:
	print('NO')


import sys
import itertools
(n, s) = map(int, input().split())
lst = list(map(int, input().split()))
friends = n - 1
for item in itertools.combinations(lst, friends):
	if sum(item) <= s:
		print('YES')
		sys.exit()
print('NO')


class CodeforcesTask426ASolution:

	def __init__(self):
		self.result = ''
		self.n_s = []
		self.mugs = []

	def read_input(self):
		self.n_s = [int(x) for x in input().split(' ')]
		self.mugs = [int(x) for x in input().split(' ')]

	def process_task(self):
		self.mugs.sort()
		self.result = 'YES' if sum(self.mugs[:-1]) <= self.n_s[1] else 'NO'

	def get_result(self):
		return self.result
Solution = CodeforcesTask426ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import sys

def main():
	(n, s, *l) = map(int, sys.stdin.read().strip().split())
	return ('NO', 'YES')[sum(l) - max(l) <= s]
print(main())


(n, c) = map(int, input().split())
arr = [int(i) for i in input().split()]
arr.sort()
for i in range(n - 1):
	c = c - arr[i]
if c >= 0:
	print('YES')
else:
	print('NO')


def sum(a):
	s = 0
	for i in a:
		s = s + i
	return s
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
print('YES' if sum(a) - max(a) <= m else 'NO')


(n, s) = map(int, input().split())
a = sorted(map(int, input().split()))
if sum(a[:n - 1]) <= s:
	print('YES')
else:
	print('NO')


(n, s) = tuple(map(int, str.split(input())))
if sum(sorted(map(int, str.split(input())))[:-1]) <= s:
	print('YES')
else:
	print('NO')


def solve(n, s, a):
	a.sort()
	if sum(a[:-1]) <= s:
		return 'YES'
	else:
		return 'NO'

def main():
	(n, s) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	print(solve(n, s, a))
main()


import sys
(n, s) = map(int, sys.stdin.readline().split())
an = list(map(int, sys.stdin.readline().split()))
ansum = sum(an)
anmax = max(an)
if ansum - anmax <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
mat = list(map(int, input().split()))
sums = sum(mat) - max(mat)
print('NO' if sums > s else 'YES')


(n, s) = map(int, input().split())
listy = list(map(int, input().split()))
listy.sort()
sum1 = 0
for i in range(n - 1):
	sum1 += listy[i]
if s >= sum1:
	print('YES')
else:
	print('NO')


(mugs_num, cup_volume) = map(int, input().split())
mugs_volume = sorted(list(map(int, input().split())))
for x in range(mugs_num - 1):
	cup_volume -= mugs_volume[x]
	if cup_volume < 0:
		print('NO')
		break
else:
	print('YES')


(n, s) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
su = 0
for i in range(n - 1):
	su += arr[i]
if su > s:
	print('NO')
else:
	print('YES')


(n, m) = list(map(int, input().split()))
l = list(map(int, input().split()))
count = 0
for i in l:
	count += i
a = count - max(l)
if a <= m:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().split())
lis = list(map(int, input().split()))
k = max(lis)
s = sum(lis)
s = s - k
if s <= m:
	print('YES')
else:
	print('NO')


import sys
from math import *
readints = lambda : map(int, input().strip('\n').split())
(n, m) = readints()
a = list(readints())
a.sort()
a.pop()
if not a or sum(a) <= m:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
if sum(arr) - max(arr) <= m:
	print('YES')
else:
	print('NO')


(n, gv) = map(int, input().split())
mv = [0] * n
mv = list(map(int, input().split()))
mv = sorted(mv)
for i in range(n - 1):
	gv = gv - mv[i]
if gv < 0:
	print('NO')
else:
	print('YES')


(m, c) = map(int, input().split())
l = list(map(int, input().split()))
s = max(l)
l.remove(s)
for i in range(len(l)):
	c = c - l[i]
if c >= 0:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
arr = list(map(int, input().split(' ')[:n]))
arr.sort()
temp = 0
for i in range(n - 1):
	temp += arr[i]
	if temp > s:
		print('NO')
		exit()
print('YES')


(n, s) = [int(x) for x in input().split(' ')]
a = sorted([int(x) for x in input().split(' ')])
if sum(a[:n - 1]) <= s:
	print('YES')
else:
	print('NO')


(n, s) = list(map(int, input().split()))
krush = list(map(int, input().split()))
chasha = 0
res = 'YES'
krush.sort()
friend = 0
while res == 'YES' and friend < len(krush) - 1:
	chasha += krush[friend]
	if chasha > s:
		res = 'NO'
	friend += 1
print(res)


a = input()
a = a.split()
a1 = int(a[0])
a2 = int(a[1])
b = input()
b = b.split()
suma = 0
for k in range(a1):
	b[k] = int(b[k])
b.sort()
for y in range(a1 - 1):
	suma = suma + b[y]
	if suma > a2:
		break
if suma <= a2:
	mensaje = 'YES'
else:
	mensaje = 'NO'
print(mensaje)


(n, s) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
result = 'NO'
m = max(a)
if sum(a) - m <= s:
	result = 'YES'
print(result)


(a, b) = map(int, input().split())
m = input().split()
sorm = sorted(m)
ans = 0
for i in range(a - 1):
	ans += int(sorm[i])
if ans > b:
	print('NO')
else:
	print('YES')


a = int(input().split()[1])
s = input().split()
d = []
for i in s:
	d.append(int(i))
if sum(d) - max(d) > a:
	print('NO')
else:
	print('YES')


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
print('YES' if sum(a) - max(a) <= k else 'NO')


(n, sz) = map(int, input().split())
a = sorted(list(map(int, input().split())))
sum = 0
for i in range(0, n - 1):
	sum += a[i]
	if sum > sz:
		print('NO')
		exit()
else:
	print('YES')


(n, v) = map(int, input().split())
l = []
l.extend(map(int, input().split()))
l.remove(max(l))
if sum(l) <= v:
	print('YES')
else:
	print('NO')


l = list(map(int, input().split()))
l1 = list(map(int, input().split()))
l1.sort()
l1.pop()
su = sum(l1)
if su <= l[1]:
	print('YES')
else:
	print('NO')


[a, b] = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) - max(l) > b:
	print('NO')
else:
	print('YES')


(n, vol) = map(int, input().split())
a = sorted(list(map(int, input().split())))
s = 0
flag = True
for i in range(n - 1):
	s += a[i]
	if s > vol:
		flag = False
		break
if flag:
	print('YES')
else:
	print('NO')


from sys import stdin, stdout
(n, s) = map(int, stdin.readline().split())
p = list(map(int, stdin.readline().split()))
if sum(p) - max(p) <= s:
	stdout.write('YES\n')
else:
	stdout.write('NO\n')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
possible = False
for i in range(0, len(a)):
	if total - a[i] <= s:
		possible = True
		break
if possible:
	print('YES')
else:
	print('NO')


(N, S) = map(int, input().split())
L = list(map(int, input().split()))
if sum(L) - max(L) <= S:
	print('YES')
else:
	print('NO')


from sys import stdin, stdout, stderr, setrecursionlimit
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	import inspect, re
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readintarr(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writearr(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
(n, s) = readintarr()
a = readintarr()
write('YES' if sum(a) - max(a) <= s else 'NO')


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
l = sorted(l)[:n - 1]
print(['NO', 'YES'][sum(l) <= k])


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, k) = map(int, input().split(' '))
l = list(map(int, input().split(' ')))
s = sum(l)
if s <= k:
	print('YES')
else:
	ans = 'NO'
	for i in l:
		if s - i <= k:
			ans = 'YES'
	print(ans)


t = input().split()
(n, c) = (int(t[0]), int(t[1]))
k = input().split()
k = [int(x) for x in k]
if sum(k) - max(k) <= c:
	print('YES')
else:
	print('NO')


import itertools
(n, m) = map(int, input().split())
l = list(map(int, input().split()))
y = list(itertools.combinations(l, n - 1))
for i in y:
	if sum(i) <= m:
		print('YES')
		break
else:
	print('NO')


n = list(map(int, input().split(' ')))
m = list(map(int, input().split(' ')))
m.sort()
t = sum(m[0:n[0] - 1])
print('YES' if t <= n[1] else 'NO')


(n, s) = map(int, input().split())
arr = list(map(int, input().split()))
summ = sum(arr)
if summ <= s:
	print('YES')
else:
	f = False
	for i in arr:
		if summ - i <= s:
			f = True
	if f:
		print('YES')
	else:
		print('NO')


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
if sum(l[:a - 1]) <= b:
	print('YES')
else:
	print('NO')


import sys
import math
import os
(n, s) = map(int, input().split())
data = list(map(int, input().split()))
data.sort()
total = 0
for i in range(n - 1):
	total = total + int(data[i])
if total <= s:
	print('YES')
else:
	print('NO')


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
del l[l.index(max(l))]
if sum(l) <= k:
	print('YES')
else:
	print('NO')


bot = True
(n, s) = map(int, input().split())
a = list(map(int, input().split()))
print('YES' if sum(a) - max(a) <= s else 'NO')


def sereja_and_mugs(n, arr):
	arr.sort()
	sum = 0
	for i in range(n[0] - 1):
		sum = sum + arr[i]
	if sum > n[1]:
		print('NO')
	else:
		print('YES')
p = list(map(int, input('').split()))
arr = list(map(int, input('').split()))
sereja_and_mugs(p, arr)


i = lambda : map(int, input().split())
(_, b) = i()
a = [*i()]
print('YNEOS'[b < sum(a) - max(a)::2])


(n, s) = input().split()
n = int(n)
s = int(s)
C = 0
ans = 'NO'
c = list(map(int, input().split()))
for a in c:
	C += a
for a in c:
	if C - a <= s:
		ans = 'YES'
print(ans)


X = list(map(int, input().split()))
Mugs = list(map(int, input().split()))
Mugs = sorted(Mugs)
print('YES' if sum(Mugs) - Mugs[X[0] - 1] <= X[1] else 'NO')


def main():
	(n, m) = [int(v) for v in input().split()]
	vals = [int(v) for v in input().split()]
	d = sum(vals) - max(vals)
	if d <= m:
		print('YES')
	else:
		print('NO')
main()


def selection_sort(n):
	for i in range(len(n) - 1):
		min = i
		for j in range(i + 1, len(n)):
			if n[j] < n[min]:
				min = j
		tem = n[min]
		n[min] = n[i]
		n[i] = tem
(number_of_mug, volum) = input().split()
number_of_mug = int(number_of_mug)
volum = int(volum)
ls = list(map(int, input().split()))
coun = False
su = 0
selection_sort(ls)
for i in range(number_of_mug - 1):
	su += ls[i]
if su <= volum:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = sorted(list(map(int, input().split())))
print('YNEOS'[sum(a) - a[n - 1] > s::2])


def canWin(c, arr):
	return sum(arr) - max(arr) <= c
(n, c) = map(int, input().split())
nums = list(map(int, input().split()))
print('YES' if canWin(c, nums) else 'NO')


R = lambda : list(map(int, input().split()))
(n, s) = R()
a = R()
ans = sum(a) - max(a)
print('YES' if ans <= s else 'NO')


(n, s) = map(int, input().split())
a = list(map(int, input().strip().split()))[:n]
m = add = 0
for i in range(0, n):
	m = max(a[i], m)
	add += a[i]
add -= m
if add <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
arr = list(map(int, input().split()))
ts = sum(arr)
ms = max(arr)
if ts - ms <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
l.sort()
for i in l:
	if s - i >= 0:
		c += 1
		s -= i
	else:
		break
if c >= n - 1:
	print('YES')
else:
	print('NO')


(a, b) = map(int, input().split())
L = list(map(int, input().split()))
L = sorted(L)
if sum(L[:a - 1]) <= b:
	print('YES')
else:
	print('NO')


(n, V) = map(int, input().split())
l = [int(x) for x in input().split()]
l.sort()
sum = 0
for x in range(n - 1):
	sum += l[x]
print('YES' if sum <= V else 'NO')


o = 0
(n, s) = map(int, input().split())
a = [int(i) for i in input().split()]
a = sorted(a)
for i in range(0, n - 1):
	o += a[i]
if o > s:
	print('NO')
else:
	print('YES')


(n, s) = map(int, input().split())
arr = [int(x) for x in input().split()]
if s >= sum(arr) - max(arr):
	print('YES')
else:
	print('NO')


(a, b) = input().split()
mugs = int(a)
volume_cup = int(b)
volume_mugs = input().split()
volume_mugs = [int(a) for a in volume_mugs]
counter = 0
for mug in volume_mugs:
	if sum(volume_mugs) - mug > volume_cup:
		counter = counter + 1
if counter == mugs:
	print('NO')
else:
	print('YES')


ri = list(map(int, input().split()))
n = ri[0]
s = ri[1]
data = list(map(int, input().split()))
maxMug = max(data)
sumMug = sum(data)
if sumMug - maxMug > s:
	print('NO')
else:
	print('YES')


a = list(map(int, input().split()))
b = list(map(int, input().split()))
b.sort(reverse=True)
x = sum(b[1:])
if a[1] < x:
	print('NO')
else:
	print('YES')


(a, b) = input().split()
(a, b) = (int(a), int(b))
c = input().split()
for i in range(a - 1):
	b -= int(min(c))
	c.remove(min(c))
if b < 0:
	print('NO')
else:
	print('YES')


(n, s) = [int(c) for c in input().split()]
cups = [int(c) for c in input().split()]
max = max(cups)
sum = sum(cups)
if sum - max <= s:
	print('YES')
else:
	print('NO')


(n, s) = input().split()
(n, s) = (int(n), int(s))
a = [int(i) for i in input().split()]
b = sum(a) - max(a)
if b > s:
	print('NO')
else:
	print('YES')


def circles(lst, m):
	del lst[lst.index(max(lst))]
	if sum(lst) <= m:
		return 'YES'
	return 'NO'
(N, M) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
print(circles(a, M))


(n, a) = map(int, input().split())
s = list(map(int, input().split()))
s.pop(s.index(max(s)))
k = 0
for i in range(n - 1):
	k += s[i]
if k <= a:
	print('YES')
else:
	print('NO')


(n, s) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
l.sort()
print('YES' if sum(l[:-1]) <= s else 'NO')


(n, s) = list(map(int, input().split()))
a = list(map(int, input().split()))
s_a = sorted(a)
t = 0
for i in range(n - 1):
	t += s_a[i]
print('YES' if t <= s else 'NO')


(i, v, f, cups) = (0, 0, 0, [])
cups = input().split(' ')
v = int(cups[1])
cups = input().split(' ')
f = len(cups) - 1
i = 0
while i <= f:
	cups[i] = int(cups[i])
	i += 1
cups.sort()
(i, s) = (0, 0)
while i < f:
	s += cups[i]
	if s > v:
		break
	i += 1
if i == f:
	print('YES')
else:
	print('NO')


(n, s) = [int(x) for x in input().split()]
a = list(map(int, input().split()))
a.remove(max(a))
if sum(a) > s:
	print('NO')
else:
	print('YES')


(n, v) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
l.pop()
if v >= sum(l):
	print('YES')
else:
	print('NO')


k = int(input().split()[1])
if sum(sorted(list(map(int, input().split())))[:-1]) > k:
	print('NO')
else:
	print('YES')


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
c = 0
for i in range(a - 1):
	c += l[i]
if c <= b:
	print('YES')
else:
	print('NO')


x = list(map(int, input().split()))
y = list(map(int, input().split()))
y.sort()
if sum(y[0:len(y) - 1]) <= x[1]:
	print('YES')
else:
	print('NO')


import itertools

def findsubsets(l, n):
	return list(itertools.combinations(l, n))
(n, vol) = input().split()
(n, vol) = (int(n), int(vol))
flag = 0
l = list(map(int, input().split()))
sub = findsubsets(l, n - 1)
for i in sub:
	if sum(i) <= vol:
		flag = 1
if flag == 1:
	print('YES')
else:
	print('NO')


(n, v) = map(int, input().split())
cups = list(map(int, input().split()))
print('YES' if sum(sorted(cups)[:n - 1]) <= v else 'NO')


(a, b) = map(int, input().split())
bb = list(map(int, input().split()))
c = []
bb.sort()
for i in range(a - 1):
	c.append(bb[i])
if sum(c) <= b:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
i = 0
while i < n - 1:
	s = s - l[i]
	i = i + 1
if s >= 0:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
t = list(map(int, input().split()))
t = sorted(t)
if sum(t[:n - 1]) <= s:
	print('YES')
else:
	print('NO')


I = lambda : map(int, input().split())
(_, s) = I()
A = list(I())
print('NO' if sum(A) - max(A) > s else 'YES')


(n, m) = map(int, input().split(' '))
li = list(map(int, input().split()))
s = sum(li)
a = max(li)
if s - a <= m:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
p = 0
for i in range(n - 1):
	p += min(a)
	a.remove(min(a))
print('YES' if p <= s else 'NO')


(n, s) = [eval(s) for s in input().split()]
array = [eval(s) for s in input().split()]
array.sort()
print('YES' if sum(array[:-1]) <= s else 'NO')


(n, s1) = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) - max(l) <= s1:
	print('YES')
else:
	print('NO')


IL = lambda : list(map(int, input().split()))
(n, s) = IL()
A = IL()
print('YES' if sum(sorted(A)[:-1]) <= s else 'NO')


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
m = max(l)
l.remove(m)
x = 0
for i in l:
	x += i
if x <= b:
	print('YES')
else:
	print('NO')


def readln():
	return tuple(map(int, input().split()))
(n, s) = readln()
a = readln()
print('YES' if sum(a) - max(a) <= s else 'NO')


(a, b) = map(int, input().split())
c = sorted(list(map(int, input().split())))
cnt = 0
for i in range(a - 1):
	if c[i] <= b:
		cnt += c[i]
	else:
		cnt += 0
if cnt > b:
	print('NO')
elif cnt == 0:
	print('NO')
else:
	print('YES')


import sys
(n, s) = map(int, sys.stdin.readline().split())
mugs = list(sorted(map(int, sys.stdin.readline().split())))
if sum(mugs[:n - 1]) <= s:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().strip().split()[:2])
l = list(map(int, input().strip().split()[:n]))
l.sort()
k = sum(l[:n - 1])
if m >= k:
	print('YES')
else:
	print('NO')


def solution(l1, l2):
	l2.remove(max(l2))
	if sum(l2) > l1[1]:
		return 'NO'
	else:
		return 'YES'

def answer():
	l1 = [int(x) for x in input().split()]
	l2 = [int(x) for x in input().split()]
	print(solution(l1, l2))
answer()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
count = 0
while n - 1 > 0:
	count += arr[0]
	arr.pop(0)
	n -= 1
if count <= k:
	print('YES')
else:
	print('NO')


data = input().rstrip().split()
n = int(data[0])
s = int(data[1])
su = 0
ma = 0
data = input().rstrip().split()
for i in range(n):
	a = int(data[i])
	su += a
	if ma < a:
		ma = a
su -= ma
print('YES' if su <= s else 'NO')


numbersString = input().split()
volumeCup = int(numbersString[1])
volumesMugsString = input().split(' ')
volumesMugs = []
for i in volumesMugsString:
	volumesMugs.append(int(i))
volumesMugs.sort()
print('YES') if sum((i for i in volumesMugs[:-1])) <= volumeCup else print('NO')


(n, m) = map(int, input().split())
arr = [int(i) for i in input().split()]
arr.sort()
if sum(arr[:n - 1]) > m:
	print('NO')
else:
	print('YES')


from sys import stdin, stdout
(n, s) = map(int, stdin.readline().split())
arr = list(map(int, stdin.readline().split()))
arr.sort()
arr = arr[:len(arr) - 1]
if sum(arr) <= s:
	stdout.write('YES\n')
else:
	stdout.write('NO\n')


(n, s) = input().split()
n = int(n)
s = int(s)
l = input().split()
sum = 0
r = 0
for i in range(n):
	l[i] = int(l[i])
	sum += l[i]
for i in range(n):
	if sum - l[i] <= s:
		print('YES')
		r = 1
		break
if r == 0:
	print('NO')


(n, m) = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
if sum(arr) - max(arr) <= m:
	print('YES')
else:
	print('NO')


import math
(n, m) = map(int, input().split())
ara = list(map(int, input().split()))
sum = 0
mx = 0
for i in range(n):
	sum += ara[i]
	mx = max(mx, ara[i])
sum -= mx
print('YES' if sum <= m else 'NO')


(a, b) = map(int, input().split())
arr = sorted(map(int, input().split()))[:-1]
if sum(arr) > b:
	print('NO')
else:
	print('YES')


from sys import stdin
(n, s) = list(map(int, stdin.readline().split()))
arr = list(map(int, stdin.readline().split()))
if sum(arr) - max(arr) > s:
	print('NO')
else:
	print('YES')


(n, m) = map(int, input().split())
l = sorted(list(map(int, input().split())))
c = 0
for i in range(n - 1):
	c += l[i]
	if c > m:
		print('NO')
		break
else:
	print('YES')


x = input()
y = input()
l = x.split()
n = l[0]
s = l[1]
list = y.split()
list.sort()
oursum = 0
i = 0
while i < len(list) - 1:
	oursum = oursum + int(list[i])
	i += 1
if oursum <= int(s):
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
arr = sorted(map(int, input().split()))
if sum(arr[0:n - 1]) <= s:
	print('YES')
else:
	print('NO')


__author__ = 'Lipen'

def main():
	(n, s) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) - max(a) <= s:
		print('YES')
	else:
		print('NO')
main()


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
del a[a.index(max(a))]
print('YES' if sum(a) <= m else 'NO')


(n, c) = map(int, input().split())
lst = list(map(int, input().split()))
lst.remove(max(lst))
s = sum(lst)
if s <= c:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
arr = list(map(int, input().split()))
count = 0
summation = sum(arr)
max1 = max(arr)
if summation - max1 <= s:
	print('YES')
else:
	print('NO')


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
v = 0
for i in range(n - 1):
	v += a[i]
	if v > m:
		print('NO')
		break
else:
	print('YES')


(n, m) = map(int, input().split())
l = []
a = list(map(int, input().split()))
a.sort()
for i in range(n - 1):
	l.append(a[i])
if sum(l) <= m:
	print('YES')
else:
	print('NO')


(n, s) = input().split()
(n, s) = (int(n), int(s))
lis = input().split()
for i in range(n):
	lis[i] = int(lis[i])
S = sum(lis) - max(lis)
if S <= s:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
m = max(a)
a.remove(m)
c = 0
for i in a:
	c += i
if c <= s:
	print('YES')
else:
	print('NO')


(a, b) = map(int, input().split())
n = list(map(int, input().split()))
n.sort()
n.pop()
if b >= sum(n):
	print('YES')
else:
	print('NO')


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	(n, s) = read_ints()
	A = read_ints()
	if sum(A) - max(A) <= s:
		YES()
	else:
		NO()

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


def sum_without_i(l, ind):
	sum = 0
	for i in range(len(l)):
		if not i == ind:
			sum += l[i]
	return sum

def main_function():
	(n, s) = [int(i) for i in input().split(' ')]
	l = [int(i) for i in input().split(' ')]
	sumof = sum(l)
	for j in range(len(l)):
		if s >= sumof - l[j]:
			return 'YES'
	if sumof <= s:
		return 'YES'
	return 'NO'
print(main_function())


__author__ = 'Dilshod'
(n, s) = map(int, input().split())
m = list(map(int, input().split()))
m.sort()
m = m[:-1]
cnt = 0
for i in m:
	if cnt + i > s:
		print('NO')
		exit()
	cnt += i
print('YES')


(n, s) = map(int, input().split())
vals = list(map(int, input().split()))
print(('NO', 'YES')[sum(vals) - max(vals) <= s])


(a, b) = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
c = sorted(c)
sum = 0
for i in range(a - 1):
	sum += c[i]
if sum <= b:
	print('YES')
else:
	print('NO')


(n, s) = map(int, input().split())
alist = [int(x) for x in input().split()]
alist.sort()
if sum(alist[:n - 1]) <= s:
	print('YES')
else:
	print('NO')


def solve(arr, s, n):
	arr = sorted(arr)
	f = n - 1
	for i in arr:
		if f == 0:
			return 'YES'
		if i <= s and s > 0:
			f -= 1
			s -= i
	return 'NO'

def main():
	(n, s) = list(map(int, input().split(' ')))
	arr = list(map(int, input().split(' ')))
	print(solve(arr, s, n))
main()


s = int(input().split()[1])
mugs = input().split()
total = 0
for i in range(len(mugs)):
	mugs[i] = int(mugs[i])
	total += mugs[i]
total -= max(mugs)
if total > s:
	print('NO')
else:
	print('YES')


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(n, s) = LI()
	l = LI()
	l.sort()
	sm = sum(l[:-1])
	if sm <= s:
		return 'YES'
	return 'NO'
print(main())


(n, s) = map(int, input().split())
arr = list(map(int, input().split()))
Sum = sum(arr)
Max = max(arr)
if Sum - Max <= s:
	print('YES')
else:
	print('NO')


n = list(map(int, input().split(' ')))
m = list(map(int, input().split(' ')))
m.sort()
t = 0
for x in range(n[0] - 1):
	t += m[x]
if t <= n[1]:
	print('YES')
else:
	print('NO')


ss = input().split()
n = int(ss[0])
s = int(ss[1])
a = list(map(int, input().split()))
a_max = max(a)
a_sum = sum(a)
if a_sum - a_max > s:
	print('NO')
else:
	print('YES')


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def ip():
	return int(sys.stdin.readline())

def sip():
	return sys.stdin.readline()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
(n, s) = mip()
arr = lip()
x = sum(arr)
y = max(arr)
if x - y > s:
	print('NO')
else:
	print('YES')


(nb_friends, volume) = [int(x) for x in input().split()]
mugs = sorted([int(x) for x in input().split()])
if sum(mugs) - mugs[-1] > volume:
	print('NO')
else:
	print('YES')


(n, s) = map(int, input().split())
a = sorted(map(int, input().split()))
x = n
for i in a:
	s -= i
	x -= 1
	if s >= 0 and x == 1 or 0:
		print('YES')
		exit()
print('NO')


line = input()
(mug_count, volume) = line.split()
(mug_count, volume) = (int(mug_count), int(volume))
line = input()
a = [int(i) for i in line.split()]
a.sort()
total = sum(a) - a[-1]
if total <= volume:
	print('YES')
else:
	print('NO')


(n, l) = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
for e in a:
	if s - e <= l:
		print('YES')
		break
else:
	print('NO')


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a.pop()
sum = 0
for i in a:
	sum += i
if sum <= s:
	print('YES')
else:
	print('NO')


(N, V) = map(int, input().split())
chars = [int(x) for x in input().split()]
count = 0
chars.sort()
yo = 0
for i in range(0, len(chars) - 1):
	yo = yo + chars[i]
if yo <= V:
	print('YES')
else:
	print('NO')


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
(n, m) = q()
print('YES' if sum(sorted([*q()])[:-1]) <= m else 'NO')