A one-dimensional Japanese crossword can be represented as a binary string of length x. An encoding of this crossword is an array a of size n, where n is the number of segments formed completely of 1's, and a_{i} is the length of i-th segment. No two segments touch or intersect.

For example:   If x = 6 and the crossword is 111011, then its encoding is an array {3, 2};  If x = 8 and the crossword is 01101010, then its encoding is an array {2, 1, 1};  If x = 5 and the crossword is 11111, then its encoding is an array {5};  If x = 5 and the crossword is 00000, then its encoding is an empty array. 

Mishka wants to create a new one-dimensional Japanese crossword. He has already picked the length and the encoding for this crossword. And now he needs to check if there is exactly one crossword such that its length and encoding are equal to the length and encoding he picked. Help him to check it!


-----Input-----

The first line contains two integer numbers n and x (1 ≤ n ≤ 100000, 1 ≤ x ≤ 10^9) — the number of elements in the encoding and the length of the crossword Mishka picked.

The second line contains n integer numbers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10000) — the encoding.


-----Output-----

Print YES if there exists exaclty one crossword with chosen length and encoding. Otherwise, print NO.


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

Output
NO

Input
3 10
3 3 2

Output
YES

Input
2 10
1 3

Output
NO

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
(n, x) = map(int, input().split())
encoding = list(map(int, input().split()))
zeros = n - 1
ones = sum(encoding)
if zeros + ones == x:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
s = sum(list(map(int, input().split()))) + n - 1
if s == x:
	print('YES')
else:
	print('NO')


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


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


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
test_count = 1
if debug:
	test_count = inp()
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	(n, x) = invr()
	a = inlt()
	total = sum(a) + n - 1
	if x == total:
		print('YES')
	else:
		print('NO')


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


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
t = sum(a)
if x - t == n - 1:
	print('YES')
else:
	print('NO')


def main():
	(n, x) = map(int, input().split())
	a = [int(c) for c in input().split()]
	print('YES' if sum(a) + n - 1 == x else 'NO')
main()


def f(n, x, arr):
	if x == sum(arr) + n - 1:
		print('YES')
	else:
		print('NO')

def __starting_point():
	(n, x) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	f(n, x, arr)
__starting_point()


(n, x) = map(int, input().split())
arr = list(map(int, input().split()))
if sum(arr) + len(arr) - 1 == x:
	print('YES')
else:
	print('NO')


inp = lambda : map(int, input().split())
(n, x) = inp()
print(['NO', 'YES'][sum(inp()) + n - 1 == x])


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


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


(segment, length) = map(int, input().split(' '))
segments = [int(x) for x in input().strip().split(' ')]
total = sum(segments)
if total + segment - 1 == length:
	print('YES')
else:
	print('NO')


from __future__ import division, print_function
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)
	print(l)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans
(n, x) = mi()
l = li()
count = 0
for i in range(n - 1):
	count += l[i] + 1
count += l[-1]
if count == x:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
if x - sum(a) == len(a) - 1 or sum(a) == 0:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
l = 0
for i in list(map(int, input().split())):
	l += i + 1
if l == -1 and x == 0:
	print('YES')
elif x == l - 1:
	print('YES')
else:
	print('NO')


s = input()
(n, x) = list(map(int, s.split()))
ss = input()
k = list(map(int, ss.split()))
countz = x - sum(k)
if countz == n - 1:
	print('YES')
else:
	print('NO')


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
d = 0
for i in range(0, len(a)):
	d = d + a[i]
d = d + (len(a) - 1)
if d == m:
	print('YES')
else:
	print('NO')


def main():
	(n, x) = (int(y) for y in input().split())
	A = [int(y) for y in input().split()]
	solver(n, x, A)

def solver(n, x, A):
	if sum(A) + n - 1 == x:
		print('YES')
	else:
		print('NO')
main()


(n, x) = map(int, input().split())
A = list(map(int, input().split()))
tot = sum(A)
print('YES' if tot + n - 1 == x else 'NO')


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


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
ln = n - 1
for i in a:
	ln += i
if ln == t:
	print('YES')
else:
	print('NO')


(groups, length) = map(int, input().split())
ones = sum(list(map(int, input().split())))
print('YES' if length - ones == groups - 1 else 'NO')


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


(n, t) = map(int, input().split())
data = list(map(int, input().split()))
s = sum(data)
print('YES' if t == n - 1 + s else 'NO')


(n, x) = map(int, input().split())
a = [int(i) for i in input().split()]
print(['NO', 'YES'][sum(a) + n - 1 == x])


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, x) = invr()
ara = inara()
tot = n - 1
for num in ara:
	tot += num
if tot == x:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split(' '))
val = [int(i) for i in input().split(' ')]
s = len(val) - 1
for i in val:
	s += i
if s == x:
	print('YES')
else:
	print('NO')


import math
import collections
import bisect

def solve(n, x, a):
	if x - sum(a) == n - 1:
		return 'YES'
	return 'NO'
(n, x) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
result = solve(n, x, a)
print(result)


(n, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
s = 0
for i in a:
	s += i
if s == x - n + 1 or n == 0:
	print('YES')
else:
	print('NO')


(n, x) = list(map(int, input().split()))
arr = list(map(int, input().split()))
z = n - 1
zz = x - sum(arr)
if zz == z:
	print('YES')
else:
	print('NO')


a = [int(l) for l in input().split()]
y = [int(i) for i in input().split()]
x = 0
for o in range(0, len(y)):
	x = x + y[o]
if x + a[0] - 1 == a[1]:
	print('YES')
else:
	print('NO')


(n, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
su = sum(a)
if x == su and len(a) == 1:
	print('YES')
elif su == 0:
	print('YES')
elif x - su == n - 1:
	print('YES')
else:
	print('NO')


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


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


(n, x) = map(int, input().split())
a = [int(x) for x in input().split()]
print('YNEOS'[not sum(a) + n - 1 == x::2])


from functools import reduce
(a, b) = input().split()
(a, b) = (int(a), int(b))
c = reduce(lambda x, y: x + y, list(map(int, input().split()))[0:a])
print('YES' if c + a - 1 == b else 'NO')


(n, length) = map(int, input().split())
lst = []
for x in input().split():
	lst.append(int(x))
k = sum(lst) + len(lst) - 1
if k == length:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
	s += l[i]
if s + n - 1 == x:
	print('yes')
else:
	print('no')


line = list(map(int, input().split()))
(n, x) = line
encoding = list(map(int, input().split()))
if sum(encoding) + n - 1 == x:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
if sum(a) + (n - 1) == m:
	print('Yes')
else:
	print('NO')


import sys
(n, x) = map(int, input().split())
t = list(map(int, input().split()))
if sum(t) + len(t) - 1 == x:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
A = list(map(int, input().split()))
sum = 0
for q in range(n):
	sum = sum + A[q]
if sum + n - 1 == x or n == 0:
	print('YES')
else:
	print('NO')


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

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

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
(n, x) = mapi()
a = list(mapi())
if sum(a) + n - 1 == x:
	print('YES')
else:
	print('NO')


import os
import sys, math
from io import BytesIO, IOBase

def main():
	t = 1
	for case in range(t):
		(n, x) = list(map(int, input().split()))
		l = list(map(int, input().split()))
		if x - sum(l) == n - 1:
			print('YES')
		else:
			print('NO')
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')
main()


def get_raw_input():
	ret = []
	for _ in range(2):
		raw = input()
		raw = raw.split(' ')
		ret.append(raw)
	return ret

def sum_array(arr):
	res = 0
	for i in arr:
		res += i
	return res
inp = get_raw_input()
arr_len = int(inp[0][0])
crossword_len = int(inp[0][1])
segments = inp[1]
for el in range(len(segments)):
	segments[el] = int(segments[el])
sum_of_ones = sum_array(segments)
if crossword_len - sum_of_ones == len(segments) - 1:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
k = 0
for i in range(len(a) - 1):
	k += a[i] + 1
k += a[len(a) - 1]
if len(a) == 0 or k == x:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
L = ['NO', 'YES']
print(L[sum(list(map(int, input().split()))) + n - 1 == x])


a = input()
n = 0
while a[0] != ' ':
	n *= 10
	n += int(a[0])
	a = a[1:]
a = a[1:]
x = 0
for i in a:
	x *= 10
	x += int(i)
a = input()
encoding = a.split(' ')
ecs = 0
for i in encoding:
	ecs += int(i)
if ecs + len(encoding) - 1 == x or n == 0:
	print('YES')
else:
	print('NO')


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


r = lambda : map(int, input().split())
(n, x) = r()
print('YES' if sum(r()) + n - 1 == x else 'NO')


(n, x) = [int(i) for i in input().split()]
lst = [int(i) for i in input().split()]
sum1 = sum(lst) + (n - 1)
if sum1 == x:
	print('YES')
else:
	print('NO')


l = [int(x) for x in input().split()]
n = l[0]
x = l[1]
l = [int(x) for x in input().split()]
count = 0
for e in l:
	count += e + 1
if count == x + 1:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) > x:
	print('NO')
elif sum(l) + n - 1 == x or (n == 1 and l[0] == x):
	print('YES')
else:
	print('NO')


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(n, x) = map(int, input().split())
A = [int(x) for x in input().split()]
if sum(A) + len(A) - 1 == x:
	print('YES')
else:
	print('NO')


(n, e) = input().split()
(n, e) = (int(n), int(e))
arr = list(map(int, input().split()))
if sum(arr) + n - 1 == e:
	print('YES')
else:
	print('NO')


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


R = lambda : list(map(int, input().split()))
(n, x) = R()
print('YES' if sum(R()) + n - 1 == x else 'NO')


(N, X) = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
Count = N - 1
for I in A:
	Count += I
if Count == X:
	print('YES')
else:
	print('NO')


(N, X) = map(int, input().split())
A = list(map(int, input().split()))
sum = 0
for i in range(0, N):
	sum += A[i]
if X - sum == N - 1:
	print('YES')
else:
	print('NO')


(size, length) = map(int, input().split())
array = map(int, input().split())
total = sum(array)
if size - 1 + total == length:
	print('YES')
else:
	print('NO')


(n, k) = map(int, input().split())
l = [int(i) for i in input().split()]
sm = sum(l)
if sm + n - 1 == k:
	print('Yes')
else:
	print('No')


line1 = input().split()
n = int(line1[0])
x = int(line1[1])
line2 = input().split()
length = n - 1
for i in range(n):
	length += int(line2[i])
if x != length:
	print('NO')
else:
	print('YES')


def main():
	(n, m) = map(int, input().split())
	print(('NO', 'YES')[sum(map(int, input().split())) + n == m + 1])
main()


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
s = sum(l) + n - 1
if m in [s]:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
flag = False
l = list(map(int, input().split()))
if x - n + 1 == sum(l):
	print('YES')
else:
	print('NO')


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


a = input().split(' ')
n = int(a[0])
x = int(a[1])
a = input().split(' ')
a = [int(i) for i in a]
if len(a) + sum(a) == x + 1:
	print('YES')
	exit()
print('NO')


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) + len(l) - 1 > x:
	print('No')
elif sum(l) + len(l) - 1 < x:
	print('No')
else:
	print('Yes')


def read_int():
	return list(map(int, input().split()))
length = read_int()[-1]
encoding = read_int()
ones = sum(encoding)
zero = len(encoding) - 1
if ones + zero == length:
	print('YES')
else:
	print('NO')


class Solver:

	def run(self):
		(n, x) = map(int, input().split())
		a = map(int, input().split())
		print('YES' if sum(a) + n - 1 == x else 'NO')
Solver().run()


def Encoding(x):
	l = list()
	if x[0] == '1':
		l.append(1)
	for i in range(1, len(x)):
		if x[i] == '0':
			continue
		elif x[i] == '1' and x[i - 1] == '0':
			l.append(1)
		else:
			l[len(l) - 1] += 1
	return l

def generatePrintBinary(n):
	from queue import Queue
	q = Queue()
	q.put('1')
	while 1:
		n -= 1
		s1 = q.get()
		if int(s1) / int(n) > 1:
			return
		s2 = s1
		q.put(s1 + '0')
		q.put(s2 + '1')
count = 0
(n, x) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
count = -1
for y in a:
	count += 1 + y
if count == x:
	print('YES')
else:
	print('NO')


(n, x) = [int(z) for z in input().split()]
a = [int(z) for z in input().split()]
cnt = 0
for i in range(n):
	cnt += a[i]
if cnt + n - 1 == x:
	print('YES')
else:
	print('NO')


s1 = input()
w = s1.split()
x = int(w[0])
n = int(w[1])
s2 = input()
s2 = s2.split()
r = []
for i in range(x):
	r.append(int(s2[i]))
s = 0
for j in r:
	s += j
if s + len(r) - 1 == n:
	print('Yes')
else:
	print('No')


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
(n, x) = mi()
a = li()
print('YES') if sum(a) + n - 1 == x else print('NO')


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
if sum(l) + (n - 1) == t:
	print('Yes')
else:
	print('NO')


(n, x) = map(int, input().split())
sm = sum(map(int, input().split()))
print('YES' if sm + n - 1 == x else 'NO')


from sys import stdin, stdout

def main():
	(n, x) = map(int, stdin.readline().split())
	s = sum(map(int, stdin.readline().split()))
	if s + n - 1 == x:
		stdout.write('YES')
	else:
		stdout.write('NO')
main()


def main():
	(n, x) = map(int, input().split())
	ns = list(map(int, input().split()))
	if n - 1 + sum(ns) == x:
		print('YES')
	else:
		print('NO')
main()


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
print('YES' if sum(a) + len(a) - 1 == m else 'NO')


(n, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) + n - 1 == x:
	print('Yes')
else:
	print('No')


(n, x) = [int(y) for y in input().split()]
numbers = [int(y) for y in input().split()]
if sum(numbers) + len(numbers) - 1 == x:
	print('YES')
else:
	print('NO')


from functools import reduce
(n, x) = map(int, input().split())
a = list(map(int, input().split()))
length = reduce(lambda x, y: x + y, a)
if x - length - (len(a) - 1) == 0:
	print('YES')
else:
	print('NO')


func = lambda x: int(x)
l1 = list(map(func, input().split()))
l2 = list(map(func, input().split()))
n = l1[0]
x = l1[1]
s = sum(l2)
if x - s != n - 1:
	print('NO')
else:
	print('YES')


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


(n, x) = map(int, input().split())
a = map(int, input().split())
for i in a:
	x = x - i
if x == n - 1:
	print('YES')
else:
	print('NO')


s = input()
(n, m) = list(map(int, s.split(' ')))
t = input()
x = t.split(' ')
x = list(map(int, x))
if sum(x) + len(x) - 1 == m:
	print('YES')
else:
	print('NO')


s = input().split()
n = int(s[0])
key = int(s[1])
s = input().split()
summ = 0
for i in s:
	summ += int(i) + 1
if summ - 1 == key:
	print('YES')
else:
	print('NO')


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


t = input()
k = input()
A = []
B = []
for x in t.split():
	A.append(int(x))
for x in k.split():
	B.append(int(x))
if sum(B) + A[0] - 1 == A[1]:
	print('YES')
else:
	print('NO')


line = input().split(' ')
n = int(line[0])
x = int(line[1])
count = 0
line = input().split(' ')
for i in range(n):
	count += int(line[i])
if count + n - 1 == x:
	print('YES')
else:
	print('NO')


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


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


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


n = [int(x) for x in input().strip().split()]
m = [int(y) for y in input().strip().split()]
if n[1] == sum(m) + n[0] - 1:
	print('YES')
else:
	print('NO')


def main():
	(n, x) = map(int, input().split())
	a = list(map(int, input().split()))
	if n < 1 or n > 100000 or x < 0 or (x > 1000000000) or (len(a) < n) or (sum(a) + len(a) - 1 != x):
		print('NO')
		return
	else:
		print('YES')
		return
main()


data1 = list(map(int, input().split()))
data2 = list(map(int, input().split()))
if sum(data2) + data1[0] - 1 == data1[1]:
	print('YES')
else:
	print('NO')


INF = int(1e+18)

def main():
	(n, x) = [int(y) for y in input().split()]
	a = [int(x) for x in input().split()]
	sum = 0
	for y in a:
		sum += y
	if x - sum == n - 1:
		print('YES')
		return
	print('NO')
main()


x = input()
x_ = x.split()
x__ = [int(d) for d in x_]
y = input()
y_ = y.split()
y__ = [int(d) for d in y_]
len_of_crossword = x__[1]
sum_of_strings_in_code = sum(y__)
no_of_string = x__[0]
q = len_of_crossword - sum_of_strings_in_code
if q == no_of_string - 1:
	print('YES')
else:
	print('NO')


from math import inf, sqrt, floor, ceil
from collections import Counter, defaultdict, deque
from heapq import heappush as hpush, heappop as hpop, heapify as h
from operator import itemgetter
from itertools import product
from bisect import bisect_left, bisect_right
(x, n) = map(int, input().split())
s = sum(list(map(int, input().split())))
if s + x - 1 == n:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
enc = map(int, input().split())
ideal = n - 1
tem = x - sum(enc)
if tem == ideal:
	print('YES')
else:
	print('NO')


class CodeforcesTask884BSolution:

	def __init__(self):
		self.result = ''
		self.n_x = []
		self.encoding = []

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

	def process_task(self):
		if sum(self.encoding) + (self.n_x[0] - 1) == self.n_x[1]:
			self.result = 'YES'
		else:
			self.result = 'NO'

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


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


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


(n, t) = (int(x) for x in input().split())
ns = [int(x) for x in input().split()]
tt = sum(ns) + len(ns) - 1
print('YES' if tt == t else 'NO')


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


a = [int(q) for q in input().strip().split()]
b = [int(q) for q in input().strip().split()]
if a[1] - sum(b) == a[0] - 1:
	print('YES')
else:
	print('NO')


while True:
	try:

		def read():
			(n, x) = map(int, input().split())
			a = list(map(int, input().split()))
			solve(n, x, a)

		def solve(n, x, a):
			s = 0
			for i in range(n):
				s += a[i]
			if s + n - 1 > x or s + n - 1 < x:
				print('NO')
			else:
				print('YES')
		if __name__ == '__main__':
			read()
	except EOFError:
		break


(n, x) = list(map(int, input().split()))
A = list(map(int, input().split()))
if x == sum(A) + n - 1 or n == 0:
	print('YES')
else:
	print('NO')


(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
p = list(map(int, input().strip().split(' ')))
x = len(p) - 1
s = 0
for i in range(n):
	s = s + p[i]
if x + s == k:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
encoding = list(map(int, input().split()))
total = 0
for (i, v) in enumerate(encoding):
	total += v
	if i != len(encoding) - 1:
		total += 1
print('YES' if total == x else 'NO')


(n, x) = map(int, input().split())
print(['NO', 'YES'][sum(map(int, input().split())) + n - 1 == x])


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


(n, l) = [int(i) for i in input().strip().split(' ')]
arr = [int(i) for i in input().strip().split(' ')]
s = 0
for i in arr:
	s += i
if s + len(arr) - 1 == l:
	print('YES')
else:
	print('NO')


import math
cin = lambda : map(int, input().split())
(n, x) = cin()
a = list(cin())
s = sum(a)
if s + n - 1 == x:
	print('YES')
else:
	print('NO')


inp = input()
(n, x) = inp.split()
n = int(n)
x = int(x)
inp2 = input()
inp2 = inp2.split()
tot = 0
for i in range(n):
	inp2[i] = int(inp2[i])
	tot += inp2[i]
	tot += 1
tot -= 1
if tot == x:
	print('YES')
else:
	print('NO')


(n, m) = map(int, input().split())
c = list(map(int, input().split()))
s = sum(c)
if n == 1 and s == m or s == m - n + 1:
	print('YES')
else:
	print('NO')


x = input().split()
y = input().split()
a = int(x[0])
b = int(x[1])
c = 0
for i in y:
	i = int(i)
	c = c + i
if b - c == a - 1:
	print('YES')
else:
	print('NO')


s1 = input().split()
n = int(s1[0])
x = int(s1[1])
s2 = input().split()
sum = 0
for i in range(0, n):
	sum = sum + int(s2[i])
if x == sum + n - 1:
	print('YES')
else:
	print('NO')


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


fl = input()
sl = input()
fl = fl.split()
sl = sl.split()
n = int(fl[0])
x = int(fl[1])
num = 0
for i in range(n):
	num += int(sl[i])
if num + n - 1 == x:
	print('YES')
else:
	print('NO')


(n, x) = map(int, input().split())
code = list(map(int, input().split()))
zeroes = n - 1
if x - sum(code) - zeroes == 0:
	print('YES')
else:
	print('NO')


from functools import reduce
(n, x) = map(int, input().split())
a = map(int, input().split())
total_length = n - 1 + reduce(lambda x, y: x + y, a)
print('YES' if total_length == x else 'NO')


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


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


a = list(map(int, input().split(' ')))
nos = a[0]
le = a[1]
S = list(map(int, input().split(' ')))
su = sum(S)
if su <= le - nos + 1:
	su = su + nos - 1
	e = le - su
	if e > 0:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


import math
for m in range(1, 2):
	(n, x) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	sum1 = sum(a)
	if sum1 == x and a[0] == x:
		print('YES')
	elif sum1 == x:
		print('NO')
	else:
		zero = len(a) - 1
		if sum1 + zero == x:
			print('YES')
		else:
			print('NO')


(n, x) = map(int, input().split())
T = list(map(int, input().split()))
s = 0
for i in T:
	s = s + i
s1 = x - n + 1
if s == s1:
	print('YES')
else:
	print('NO')


def list_input():
	return list(map(int, input().split()))
[n, x] = list_input()
a = list_input()
s = sum(a)
if n - 1 + s == x:
	print('YES')
	exit(0)
print('NO')


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
(n, x) = map(int, input().split())
if x == sum(map(int, input().split())) + n - 1:
	print('YES')
else:
	print('NO')


f = lambda : map(int, input().split())
(n, k) = f()
print('YES' if sum(f()) + n - 1 == k else 'NO')


import sys
(n, m) = map(int, sys.stdin.readline().split())
arr = list(map(int, sys.stdin.readline().split()))
val = sum(arr)
temp = m - val
if temp == n - 1:
	print('YES')
else:
	print('NO')


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


d = input().split(' ')
n = int(d[1])
lenc = int(d[0])
d = list(map(lambda x: int(x), input().split(' ')))
if sum(d) + lenc - 1 == n:
	print('YES')
else:
	print('NO')


a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
summ = len(b) - 1
for i in range(a[0]):
	summ += b[i]
if summ == a[1]:
	print('YES')
else:
	print('NO')


(amount_array, limit) = [int(i) for i in input().split()]
total = 0
for j in [int(i) for i in input().split()]:
	total += j
if total + amount_array - 1 == limit:
	print('YES')
else:
	print('NO')


(n, x) = list(map(int, input().split()))
if n != 0:
	lens = list(map(int, input().split()))
	must_len = n - 1 + sum(lens)
	if must_len == x:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


(n, k) = map(int, input().split())
x = [int(i) for i in input().split()]
print('YES' if sum(x) + len(x) - 1 == k else 'NO')


(n, x) = map(int, input().split())
s = 0
for c in input().split():
	s += int(c)
print('YES' if x - s - (n - 1) == 0 else 'NO')