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: interview

Starter code:

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


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

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

n, x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
if sum(a) + n - 1 == x:
    print('YES')
else:
    print('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(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")


n,x=list(map(int,input().split()))
a=list(map(int,input().split()))
sum1=sum(a)


if((x-sum1)==n-1):
    print("YES")
else:
    print("NO")




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")

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()


n,x=list(map(int,input().split()))
a=list(map(int,input().split()))
if sum(a)+len(a)-1==x:
    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')

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")
    return
print("NO")


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


n, x = input().split()
n = int(n)
x = int(x)

sum = 0
for i in input().split():
    sum += int(i)

if sum + n-1 != x:
    print("NO")
else:
    print("YES")

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()))
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')


# -*- coding: utf-8 -*-

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()))

  # for i in range(n):
  #   list(map(int, input().split()))

  f(n, x, arr)
__starting_point()

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')

n, x = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]

if sum(a) == (x - n + 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')

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, x = list(map(int, input().split()))
s = sum(list(map(int, input().split())))
if s + n - 1 == x:
    print("YES")
else:
    print("NO")


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


# your code goes here
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")

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