For a given array $a$ consisting of $n$ integers and a given integer $m$ find if it is possible to reorder elements of the array $a$ in such a way that $\sum_{i=1}^{n}{\sum_{j=i}^{n}{\frac{a_j}{j}}}$ equals $m$? It is forbidden to delete elements as well as insert new elements. Please note that no rounding occurs during division, for example, $\frac{5}{2}=2.5$.


-----Input-----

The first line contains a single integer $t$ — the number of test cases ($1 \le t \le 100$). The test cases follow, each in two lines.

The first line of a test case contains two integers $n$ and $m$ ($1 \le n \le 100$, $0 \le m \le 10^6$). The second line contains integers $a_1, a_2, \ldots, a_n$ ($0 \le a_i \le 10^6$) — the elements of the array.


-----Output-----

For each test case print "YES", if it is possible to reorder the elements of the array in such a way that the given formula gives the given value, and "NO" otherwise.


-----Example-----
Input
2
3 8
2 5 1
4 4
0 1 2 3

Output
YES
NO



-----Note-----

In the first test case one of the reorders could be $[1, 2, 5]$. The sum is equal to $(\frac{1}{1} + \frac{2}{2} + \frac{5}{3}) + (\frac{2}{2} + \frac{5}{3}) + (\frac{5}{3}) = 8$. The brackets denote the inner sum $\sum_{j=i}^{n}{\frac{a_j}{j}}$, while the summation of brackets corresponds to the sum over $i$.

Difficulty: EASY
Tags: Mathematics

Starter code:

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


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


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	(n, m) = list(map(int, sys.stdin.readline().split()))
	L = [int(ele) for ele in sys.stdin.readline().split()]
	if sum(L) == m:
		print('YES')
	else:
		print('NO')


import sys
import time
import os
from math import sqrt, log, log2, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
from itertools import permutations
import heapq
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
flol = lambda : list(map(float, inp().split(' ')))
flush = lambda : stdout.flush()

def permute(nums):

	def fun(arr, nums, cur, v):
		if len(cur) == len(nums):
			arr.append(cur.copy())
		i = 0
		while i < len(nums):
			if v[i]:
				i += 1
				continue
			else:
				cur.append(nums[i])
				v[i] = 1
				fun(arr, nums, cur, v)
				cur.pop()
				v[i] = 0
				i += 1
		return arr
	res = []
	nums.sort()
	v = [0] * len(nums)
	return fun(res, nums, [], v)

def subsets(res, index, arr, cur):
	res.append(cur.copy())
	for i in range(index, len(arr)):
		cur.append(arr[i])
		subsets(res, i + 1, arr, cur)
		cur.pop()
	return res

def sieve(N):
	root = int(sqrt(N))
	primes = [1] * (N + 1)
	(primes[0], primes[1]) = (0, 0)
	for i in range(2, root + 1):
		if primes[i]:
			for j in range(i * i, N + 1, i):
				primes[j] = 0
	return primes

def bs(arr, l, r, x):
	if x < arr[0] or x > arr[len(arr) - 1]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	p = int(sqrt(n))
	for i in range(5, p + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def solve():
	(n, m) = mint()
	arr = intl()
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')
start_time = time.time()
for _ in range(iinp()):
	solve()


from math import factorial
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	gcd = factorial(n)
	a = list(map(int, input().split()))
	m *= gcd
	summ = 0
	for i in range(n):
		summ += a[i] * gcd
	if summ == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	print('YES' if sum(a) == m else 'NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	s = list(map(int, input().split()))
	if sum(s) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = list(map(int, input().split()))
	c = list(map(int, input().split()))
	if sum(c) == b:
		print('YES')
	else:
		print('NO')


t = int(input())
for tc in range(t):
	(n, m) = map(int, input().split())
	a = map(int, input().split())
	ans = sum((i for i in a))
	print('YES' if ans == m else 'NO')


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


t = int(input())
(N, M) = ([], [])
A = []
for _ in range(t):
	(t1, t2) = map(int, input().split())
	N.append(t1)
	M.append(t2)
	t3 = list(map(int, input().split()))
	A.append(t3)
for i in range(t):
	if sum(A[i]) == M[i]:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	x = input()
	n = int(x.split()[0])
	m = int(x.split()[1])
	a = input()
	a1 = a.split()
	for i in range(n):
		a1[i] = int(a1[i])
	if sum(a1) == m:
		print('YES')
	else:
		print('NO')


from typing import Tuple

def solve(m: int, arr: list) -> str:
	r = sum(arr)
	if r == m:
		return 'YES'
	else:
		return 'NO'

def readCases() -> Tuple[int, list]:
	(_, m) = input().split()
	l = [int(x) for x in input().split()]
	return (int(m), l)
t = int(input())
while True:
	try:
		for i in range(t):
			(m, arr) = readCases()
			res = solve(m, arr)
			print(res)
	except EOFError:
		break


t = int(input())
b = []
c = []
for i in range(t):
	(n, m) = map(int, input().split())
	c.append(m)
	w = map(int, input().split())
	x = sum(list(w))
	b.append(x)
for k in range(len(b)):
	if b[k] == c[k]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(N, K) = [int(i) for i in input().split(' ')]
	A = [int(i) for i in input().split(' ')]
	S = sum(A)
	if S == K:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	l0 = [int(x) for x in input().split(' ')]
	l1 = [int(x) for x in input().split(' ')]
	if sum(l1) == l0[1]:
		print('YES')
	else:
		print('NO')


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	res = 0
	for x in range(n):
		for y in range(x, n):
			res += a[y] / (y + 1)
	print(['NO', 'YES'][abs(res - m) < 10 ** (-5)])


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	s = sum(map(int, input().split()))
	print('YES' if s == m else 'NO')


T = int(input())
for t in range(T):
	(N, M) = [int(i) for i in input().split(' ')]
	arr = [int(i) for i in input().split(' ')]
	if sum(arr) == M:
		print('YES')
	else:
		print('NO')


import os
import sys
from io import BytesIO, IOBase

def solution(arr, n, m):
	write('YES' if sum(arr) == m else 'NO')

def main():
	for _ in range(r_int()):
		(n, m) = r_array()
		arr = r_array()
		solution(arr, n, m)
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


for Pythonic__Python in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if m == sum(l):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	ans = 0
	for i in range(n):
		ans += arr[i]
	if ans == k:
		print('YES')
	else:
		print('NO')


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


for y in range(int(input())):
	(a, b) = map(int, input().split())
	lst = list(map(int, input().split()))
	if sum(lst) == b:
		print('YES')
	else:
		print('NO')


import sys
try:
	(sys.stdin, sys.stdout) = (open('in.txt', 'r'), open('out.txt', 'w'))
except:
	pass
ii1 = lambda : int(sys.stdin.readline().strip())
is1 = lambda : sys.stdin.readline().strip()
iia = lambda : list(map(int, sys.stdin.readline().strip().split()))
isa = lambda : sys.stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
from collections import *
from math import *
for _ in range(ii1()):
	(n, m) = iia()
	arr = iia()
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


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


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


t = int(input())
for _ in range(t):
	(n, x) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == x:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, x) = map(int, input().split())
	lst = list(map(int, input().split()))
	s = 0
	s = sum(lst)
	if s == x:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	a = [int(s) for s in input().split()]
	s = 0
	for j in range(n):
		s += a[j]
	if m == s:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rs = lambda : input().decode().rstrip('\n\r')
wrt = sys.stdout.write
pr = lambda *args, end='\n': wrt(' '.join([str(x) for x in args]) + end)
enum = enumerate
inf = float('inf')
cdiv = lambda x, y: -(-x // y)
mod = 10 ** 9 + 7
Cases = ri()
for Case in range(Cases):
	(n, m) = rl()
	a = rl()
	if sum(a) == m:
		pr('YES')
	else:
		pr('NO')


import os
import sys
from collections import Counter
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 solve():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	a.append(-1)
	a.sort()
	summ = 0
	summ = float(summ)
	for i in range(1, n + 1):
		summ += i * (a[i] / i)
	if summ == m:
		print('YES')
	else:
		print('NO')

def main():
	t = int(input())
	for i in range(t):
		solve()
main()


from collections import *
from itertools import *
from bisect import *

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

def arrinp():
	return [int(x) for x in input().split()]

def main():
	t = inp()
	for _ in range(t):
		(n, m) = arrinp()
		A = arrinp()
		x = sum(A)
		if x == m:
			print('YES')
		else:
			print('NO')
main()


from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	(n, m) = M()
	a = LI()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys, collections
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
rs = list()
for i in range(0, t):
	(a, m) = input().split()
	a = int(a)
	m = int(m)
	asum = 0
	an = [int(a) for a in input().split()]
	for j in range(0, a):
		asum += an[j]
	if asum == m:
		rs.append('YES')
	else:
		rs.append('NO')
for i in range(0, len(rs)):
	print(rs[i])


from collections import Counter
from collections import OrderedDict
from collections import defaultdict
import bisect

def freq_count(mylist):
	return Counter(mylist)
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	sum1 = 0
	for i in range(n):
		sum1 += arr[i]
	if sum1 == m:
		print('YES')
	else:
		print('NO')


from sys import stdin
nii = lambda : map(int, stdin.readline().split())
lnii = lambda : list(map(int, stdin.readline().split()))
t = int(input())
for i in range(t):
	(n, m) = nii()
	b = lnii()
	if sum(b) == m:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
inputs = lambda converter: map(converter, input().split())

def main():
	testc = int(input())
	while testc > 0:
		testc -= 1
		(n, m) = list(inputs(int))
		arr = list(inputs(int))
		psum = [0 for i in range(n + 1)]
		for i in range(n):
			psum[i + 1] = psum[i] + arr[i] / (i + 1)
		ans = 0
		for i in range(n):
			ans += psum[n] - psum[i]
		if m + 0.15 >= ans and ans + 0.15 >= m:
			print('YES')
		else:
			print('NO')
main()


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key
from heapq import *
from math import gcd, factorial, floor, ceil
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

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

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
inf = pow(10, 20)
mod = 10 ** 9 + 7

def solve(case):
	(n, m) = sep()
	a = lis()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')
testcase(int(inp()))


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


for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	arr.sort()
	l = []
	s = 0
	for i in range(1, n + 1):
		l.append(arr[i - 1] / i)
	for x in range(len(l)):
		s += sum(l[x:])
	if round(s) == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	w = map(int, input().split())
	e = sum(w)
	if e == b:
		print('YES')
	else:
		print('NO')


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


for _ in range(int(input())):
	(n, m) = [int(i) for i in input().split()]
	if sum([int(i) for i in input().split()]) == m:
		print('YES')
	else:
		print('NO')


from sys import stdin
tc = int(stdin.readline().strip())
for _ in range(tc):
	(a, b) = list(map(int, stdin.readline().strip().split()))
	arr = list(map(int, stdin.readline().strip().split()))
	if sum(arr) == b:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, t) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == t:
		print('YES')
	else:
		print('NO')


t = int(input())
for q in range(0, t):
	(n, m) = map(int, input().split())
	a = [int(i) for i in input().split()]
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(N, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	print('YES') if sum(arr) == m else print('NO')


import sys
from itertools import permutations

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

def list2d(a, b, c):
	return [[c for j in range(b)] for i in range(a)]

def list3d(a, b, c, d):
	return [[[d for k in range(c)] for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** (-10)
for _ in range(INT()):
	(N, K) = MAP()
	A = LIST()
	if sum(A) == K:
		YES()
	else:
		NO()


for _ in range(int(input())):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	lst = list(map(int, input().split()))
	sum = 0
	for i in range(len(lst)):
		sum = sum + lst[i]
	if sum == m:
		print('YES')
	else:
		print('NO')


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


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	li = [int(ele) for ele in input().split()]
	if sum(li) == m:
		print('YES')
	else:
		print('NO')


import sys
input = iter(sys.stdin.read().splitlines()).__next__
TC = int(input())
for tc in range(TC):
	(N, M) = map(int, input().split())
	A = list(map(int, input().split()))
	if sum(A) == M:
		print('YES')
	else:
		print('NO')


t = int(input())
i = 0
while i < t:
	nm = list(map(int, input().split()))
	a = list(map(int, input().split()))
	n = nm[0]
	m = nm[1]
	S = sum(a)
	if S == m:
		print('YES')
	else:
		print('NO')
	i += 1


for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	numbers = sum(list(map(int, input().split())))
	print(('NO', 'YES')[numbers == m])


def solve(n, m, a):
	if sum(a) == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	print(solve(n, m, a))


for i in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if sum(list(map(int, input().split()))) == k:
		print('YES')
	else:
		print('NO')


import sys, math, bisect
inf = float('inf')
mod = 10 ** 9 + 7

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

def gcd(a, b):
	return int(math.gcd(a, b))

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def freq(a, x):
	z = upperBound(a, x) - lowerBound(a, x)
	if z <= 0:
		return 0
	return z
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == k:
		print('YES')
	else:
		print('NO')


p = int(input())
for w in range(p):
	(a, b) = map(int, input().split())
	c = sum(list(map(int, input().split())))
	if c == b:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	l = [int(x) for x in input().split()]
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


import sys
for _ in range(int(input())):
	(n, m) = map(int, sys.stdin.readline().strip().split())
	a = list(map(int, sys.stdin.readline().strip().split()))
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')


import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	ar = list(map(int, input().split()))
	if sum(ar) != m:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(n, m) = [int(x) for x in input().split(' ')]
	z = [int(x) for x in input().split(' ')]
	s = sum(z)
	if s == m:
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	while t > 0:
		(n, m) = map(int, input().split())
		li = list(map(int, input().split()))
		sumt = sum(li)
		if sumt == m:
			print('YES')
		else:
			print('NO')
		t -= 1
main()


a = int(input())
for i in range(a):
	(x, y) = map(int, input().split())
	z = list(map(int, input().split()))
	if sum(z) == y:
		print('YES')
	else:
		print('NO')


from math import *
import threading
import sys

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def graph(n, m):
	adj = dict()
	for i in range(1, n + 1):
		adj.setdefault(i, 0)
	for i in range(m):
		(a, b) = map(int, input().split())
		adj[a] += 1
		adj[b] += 1
	return adj

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li
INF = 1000000000.0
primes = SieveOfEratosthenes(1300000)

def fn(n):
	i = 2
	res = n - 1
	val = 0
	for i in range(int(sqrt(n)) + 1, 1, -1):
		val = i - 1 + int(ceil((n - i) / i))
		if val <= res:
			res = val
		else:
			break
	return res

def solve(a, b, c):
	dis = b ** 2 - 4 * a * c
	ans1 = (-b - sqrt(dis)) / (2 * a)
	print(int(ans1))
	return
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
tests = int(sys.stdin.readline())
for _ in range(tests):
	(n, m) = list(map(int, sys.stdin.readline().split()))
	arr = list(map(int, sys.stdin.readline().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, y) = [int(q) for q in input().split()]
	a = [int(q) for q in input().split()]
	if sum(a) == y:
		print('YES')
	else:
		print('NO')


from collections import deque
import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
t = int(input())
for _ in range(t):
	(n, m) = get_ints()
	a = list(get_ints())
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(n, s) = list(map(int, input().split()))
		array = list(map(int, input().split()))
		if sum(array) == s:
			yield 'YES'
		else:
			yield 'NO'
t = int(input())
ans = gift()
print(*ans, sep='\n')


cases = int(input())
while cases:
	cases -= 1
	(n, m) = map(int, input().split())
	arr = map(int, input().split())
	print('YES' if sum(arr) == m else 'No')


for _ in range(int(input())):
	x = int(input().split()[1])
	print('YES' if x == sum(list(map(int, input().split()))) else 'NO')


test = int(input())
for _ in range(test):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	sum_ = 0
	for a in arr:
		sum_ += a
	if sum_ == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for caseNr in range(1, t + 1):
	(n, m) = list(map(int, input().split()))
	array = list(map(int, input().split()))
	if sum(array) == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = list(map(int, input().split()))
	numbers = sorted(list(map(int, input().split())))
	sum_numbers = 0
	counter = 1
	for i in range(1, len(numbers) + 1):
		sum_numbers += numbers[i - 1] / i * counter
		counter += 1
	if sum_numbers == float(m):
		print('YES')
	else:
		print('NO')


rn = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rns = lambda : map(int, input().split())
rs = lambda : input()
yn = lambda x: print('Yes') if x else print('No')
YN = lambda x: print('YES') if x else print('NO')
for _ in range(rn()):
	(n, m) = rns()
	l = rl()
	YN(sum(l) == m)


def solve(a, b):
	return sum(b) == a
T = int(input())
for _ in range(T):
	a = list(map(int, input().split()))[1]
	b = list(map(int, input().split()))
	res = solve(a, b)
	print('YES' if res else 'NO')


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


def main():
	t = int(input())
	for _ in range(t):
		(n, m) = map(int, input().split())
		ary = list(map(int, input().split()))
		if sum(ary) == m:
			print('YES')
		else:
			print('NO')
main()


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


import bisect, math

def foo(arr, n, m):
	return 'YES' if sum(arr) == m else 'NO'
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(foo(arr, n, m))


uh = lambda : map(int, input().split())
for _ in ' ' * int(input()):
	(n, m) = uh()
	print('YES' if sum(uh()) == m else 'NO')


from sys import stdin, stdout
for t in range(int(stdin.readline())):
	(n, m) = map(int, stdin.readline().split())
	a = map(int, stdin.readline().split())
	print('YES' if sum(a) == m else 'NO')


import os

def sums_wrapper(a, d):
	if len(a) == 1:
		aux = (a[0],)
		if aux in d:
			pass
		else:
			yield (a[0],)
	else:
		for i in range(len(a)):
			aux = (a[i],)
			for t in sums_wrapper(a[:i] + a[i + 1:], d):
				yield (aux + t)

def main():
	test_cases = int(input())
	ans = [None] * test_cases
	for t in range(test_cases):
		(n, m) = tuple(map(int, input().split()))
		a = list(map(int, input().split()))
		d = set()
		ans[t] = 'NO'
		if sum(a) == m:
			ans[t] = 'YES'
	os.write(1, '\n'.join(ans).encode())
main()


import sys
import math

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

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

def get_string():
	return sys.stdin.readline().strip()
for t in range(int(input())):
	(n, m) = get_ints()
	arr = get_list()
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


import math

def sumQ(array, n, i):
	total = 0
	for v in range(i, n):
		total += array[v - 1] / v
	return total

def reorder(m, array):
	if sum(array) == m:
		return 'YES'
	else:
		return 'NO'
length = int(input())
m = []
reorders = []
for i in range(length):
	m.append(int(input().split()[1]))
	userInput = input().split(' ')
	for v in userInput:
		userInput[userInput.index(v)] = int(v)
	reorders.append(userInput)
for i in range(len(reorders)):
	print(reorder(m[i], reorders[i]))


t = int(input())
for i in range(t):
	(a, b) = input().strip().split(' ')
	(a, b) = [int(a), int(b)]
	p = list(map(int, input().strip().split(' ')))
	k = sum(p)
	if k == b:
		print('YES')
	else:
		print('NO')


for i in range(int(input(''))):
	x = list(input('').split(' '))
	y = list(input('').split(' '))
	s = 0
	for i in y:
		s += int(i)
	if int(x[1]) == s:
		print('YES')
	else:
		print('NO')


t = int(input())
for q in range(t):
	(n, m) = map(int, input().split())
	mass = [int(x) for x in input().split()]
	answer = 0
	if sum(mass) == m:
		print('YES')
	else:
		print('NO')


inp1 = int(input())
for i in range(inp1):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	inp3 = list(map(int, input().split()))
	if sum(inp3) == b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	print('YES') if sum(lis) == k else print('NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
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
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

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

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 ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	l = list(map(int, input().split()))
	if b == sum(l):
		print('YES')
	else:
		print('NO')


t = int(input())
ans = []

def fact(n):
	if n == 1 or n == 0:
		return 1
	else:
		return fact(n - 1) * n

def formula(n, ai):
	res = 0
	l = fact(n)
	for i in range(1, n + 1):
		for j in range(i, n + 1):
			res += ai[j - 1] * (l // j)
	return res // l
for i in range(t):
	(n, m) = map(int, input().split())
	ai = list(map(int, input().split()))
	if formula(n, ai) == m:
		ans.append('YES')
	else:
		ans.append('NO')
for k in ans:
	print(k)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = [int(i) for i in input().split()]
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


for tc in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


def cmp(key):
	return key[0]
from math import floor, ceil
t = int(input())
for i in range(t):
	(n, m) = [int(j) for j in input().split()]
	a = [int(мявк) for мявк in input().split()]
	a = sum(a)
	if a == m:
		print('YES')
	else:
		print('NO')


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')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

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

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	print('YES' if sum(a) == k else 'NO')


def reorder(arr, n, s):
	arr.sort(reverse=True)
	mysum = 0
	for i in range(n):
		mysum += (n - i) * arr[i] // (n - i)
	if mysum == s:
		print('YES')
	else:
		print('NO')
t = int(input())
while t > 0:
	(n, m) = list(map(int, input().split(' ')))
	arr = list(map(int, input().split(' ')))
	reorder(arr, n, m)
	t -= 1


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	summing = sum(l)
	if summing == m:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	num = list(map(int, input().split()))
	if sum(num) == k:
		print('YES')
	else:
		print('NO')


from collections import deque
from collections import OrderedDict
from queue import PriorityQueue
from operator import attrgetter
import math
import sys
import os
import threading
import bisect
import operator
import queue
import heapq
from atexit import register
from io import BytesIO
import io
from sys import stdin, stdout
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')
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	ar = list(map(int, input().split()))
	if sum(ar) == m:
		print('YES')
	else:
		print('NO')


from sys import stdin
for _ in range(int(stdin.readline())):
	(n, m) = map(int, stdin.readline().split())
	array = list(map(int, stdin.readline().split()))
	sums = sum(array)
	if sums == m:
		print('YES')
	else:
		print('NO')


import sys, os.path
from collections import *
from heapq import *
from copy import *
import math
mod = 10 ** 9 + 7
read = lambda : map(int, input().split())
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for t in range(int(input())):
	summ = 0
	(n, m) = read()
	a = list(read())
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


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


import sys
import math
from sys import stdin
from functools import reduce
from datetime import datetime
CAPITAL = True
MOD = 1000000007

def factors(n):
	l = list()
	for i in range(1, math.sqrt(n) + 1):
		if i % n == 0:
			l.append(reduce(list.__add__, [i, n // i]))
	return set(l)

def binarySearch(l, h, arr, x):
	if l > h:
		return -1
	mid = (l + h) // 2
	if arr[mid] == x:
		return mid
	if arr[mid] < x:
		l = mid + 1
	else:
		h = mid - 1
	return binarySearch(l, h, arr, x)

def readList():
	return list(map(int, stdin.readline().strip().split()))

def readIntList(n):
	if n == 0:
		return readList()
	arr = []
	for i in range(n):
		arr.append(readList())
	return arr

def readString():
	s = stdin.readline()
	return s

def readInput():
	t = 1
	t = int(stdin.readline())
	q = list()
	for _ in range(t):
		n = readIntList(0)
		arr = readIntList(0)
		q.append((n, arr))
	return (t, q, False)

def printYesOrNo(capital, yn):
	if yn:
		print('YES' if capital else 'Yes')
	else:
		print('NO' if capital else 'No')

def unitTest():
	t = 1
	q = list()
	return (t, q, True)

def solve(t, q):
	for _ in range(t):
		(n, m) = (q[_][0][0], q[_][0][1])
		if m == sum(q[_][1]):
			printYesOrNo(CAPITAL, True)
		else:
			printYesOrNo(CAPITAL, False)
(t, q, clk) = readInput()
startClock = datetime.now()
solve(t, q)
endClock = datetime.now()
print(endClock - startClock if clk else '', end='')


a = int(input())
for x in range(a):
	(b, c) = map(int, input().split())
	d = list(map(int, input().split()))
	if sum(d) == c:
		print('YES')
	else:
		print('NO')


t = int(input().strip())
while t > 0:
	t -= 1
	[n, sm] = list(map(int, input().strip().split()))
	l1 = list(map(int, input().strip().split()))
	if sm == sum(l1):
		ans = 'YES'
	else:
		ans = 'NO'
	print(ans)


t = int(input())
for i in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	lst1 = list(map(int, input().split()))
	a = sum(lst1)
	if a == m:
		print('YES')
	else:
		print('NO')


read = lambda : map(int, input().split())
(a,) = read()
for _ in [0] * a:
	(n, m) = read()
	print('YNEOS'[sum(read()) != m::2])


import os
from re import X
import sys
import math

def solve():
	(n, m) = list(map(int, input().split()))
	numbers = list(map(int, input().split()))
	sum = 0
	for i in range(n):
		sum += numbers[i]
	if sum == m:
		print('YES')
	else:
		print('NO')
	return
if os.path.exists('input.txt') and os.path.exists('output.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline

def main():
	(n, m) = map(int, input().split())
	alst = list(map(int, input().split()))
	if sum(alst) == m:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	main()


import sys
LI = lambda : list(map(int, sys.stdin.readline().strip('\n').split()))
MI = lambda : map(int, sys.stdin.readline().strip('\n').split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline().strip('\n'))
for _ in range(II()):
	(n, m) = MI()
	print('YES' if sum(MI()) == m else 'NO')


n = int(input(''))
for i in range(n):
	l = list(map(int, input().split()))
	l1 = list(map(int, input().split()))
	if l[1] == sum(l1):
		print('YES')
	else:
		print('NO')


t = input('')
t = int(t)
while t > 0:
	t -= 1
	result = 'No'
	nm = input('').split(' ')
	n = int(nm[0])
	m = int(nm[1])
	astr = input('')
	a = astr.split(' ')
	total = 0
	for num in a:
		total += int(num)
	if m == total:
		result = 'Yes'
	print(result)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	ans = list(map(int, input().split()))
	print(('YES', 'NO')[sum(ans) != k])


def f(n, m, arr):
	if sum(arr) == m:
		return 'YES'
	return 'NO'
t = int(input())
for i in range(t):
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	print(f(n, m, arr))
pass


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == y:
		print('YES')
	else:
		print('NO')


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	print('YES' if sum(a) == m else 'NO')


for t in range(int(input())):
	(n, m) = map(int, input().split())
	l = tuple(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


def main():
	TC = int(input())
	while TC:
		(n, m) = input().split(' ')
		m = int(m)
		totalSum = sum([int(x) for x in input().split()])
		if m == totalSum:
			print('YES')
		else:
			print('NO')
		TC -= 1
	return 0
main()


for t in range(int(input())):
	(n, m) = list(map(int, input().split()))
	nums = list(map(int, input().split()))
	if sum(nums) == m:
		print('YES')
	else:
		print('NO')


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

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def solve(n, m, a):
	sm = 0
	for i in range(n):
		for j in range(i, n):
			sm += a[j] / (j + 1)
	sm = round(sm)
	if int(sm) == sm:
		if sm == m:
			return 'YES'
	return 'NO'
t = read_int()
for case in range(t):
	(n, m) = read_ints()
	a = read_ints()
	sol = solve(n, m, a)
	print(sol)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	s = sum(A)
	if s == m:
		print('YES')
	else:
		print('NO')


s = int(input())
for d in range(s):
	a = []
	(n, m) = map(int, input().split())
	a = map(int, input().split())
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


from typing import *

def can_get_value(l: List[int], m: int) -> str:
	if sum(l) == m:
		return 'YES'
	return 'NO'

def main():
	result: List[str] = []
	for _ in range(int(input())):
		(_, m) = [int(i) for i in input().split()]
		result.append(can_get_value([int(i) for i in input().split()], m))
	for r in result:
		print(r)
main()


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	A = sum(map(int, input().split()))
	if A == m:
		print('YES')
	else:
		print('NO')


import sys
import os.path
import math
import heapq
from sys import stdin, stdout
from collections import *
from math import gcd, ceil, floor
mod = int(1000000000.0 + 7)
if os.path.exists('Updated prg/Input3d.txt'):
	sys.stdout = open('Updated prg/Output3d.txt', 'w')
	sys.stdin = open('Updated prg/Input3d.txt', 'r')

def sinp():
	return input()

def ninp():
	return int(sinp())

def mapinp():
	return map(int, sinp().split())

def linp():
	return list(mapinp())

def sl():
	return list(sinp())

def prnt(a):
	print(a)

def prntl(a):
	print(a, end=' ')

def prntlist(l1):
	print(*l1)

def power(n):
	return 1 << n
for _ in range(ninp()):
	(n, m) = mapinp()
	l1 = linp()
	s1 = sum(l1)
	if s1 == m:
		prnt('YES')
	else:
		prnt('NO')


def main():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().strip().split())
		nums = list(map(int, input().strip().split()))
		if sum(nums) == k:
			print('YES')
		else:
			print('NO')
main()


for u in range(int(input())):
	(n, m) = map(int, input().split())
	x = [int(w) for w in input().split()]
	if sum(x) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')


for _ in ' ' * int(input()):
	(a, b) = map(int, input().split())
	z = [0] + sorted(map(int, input().split()))
	if sum(z) == b:
		print('YES')
	else:
		print('NO')


import sys
import math

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

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

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

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	(n, m) = MI()
	a = LI()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	nm = input().split()
	a = input().split()
	a_mod = []
	for i in range(int(nm[0])):
		a_mod.append(int(a[i]))
	if sum(a_mod) == int(nm[1]):
		print('YES')
	else:
		print('NO')


t = int(input())
for case in range(t):
	(n, m) = [int(x) for x in input().split(' ')]
	a = [int(x) for x in input().split(' ')]
	if sum(a) == m:
		ans = 'YES'
	else:
		ans = 'NO'
	print(ans)


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				divisors.append(i)
			else:
				divisors.extend((i, n // i))
		i = i + 1
	return divisors

def countTotalBits(num):
	binary = bin(num)[2:]
	return len(binary)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for _ in range(vary(1)):
	(n, m) = vary(2)
	num = array_int()
	if sum(num) == m:
		print('YES')
	else:
		print('NO')


pn = int(input())
for i in range(pn):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	sa = sum(a)
	if sa == m:
		print('YES')
	else:
		print('NO')


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')
import math
from collections import Counter, defaultdict, deque

def int1():
	return int(input())

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

def list1():
	return list(map(int, input().split()))
mod = pow(10, 9) + 7

def solve():
	(n, m) = map1()
	l1 = list1()
	sum1 = sum(l1)
	if sum1 == m:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	solve()


T = int(input())
while T > 0:
	(n, m) = map(int, input().split())
	nums = list(map(int, input().split()))
	if sum(nums) == m:
		print('Yes')
	else:
		print('No')
	T -= 1


t = int(input())
while t > 0:
	(n, m) = [int(i) for i in input().split(' ')]
	l = [int(i) for i in input().split(' ')]
	if sum(l) == m:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
ans = []
for i in range(t):
	sub = list(map(int, input().rstrip().split()))
	n = sub[0]
	m = sub[1]
	num = list(map(int, input().rstrip().split()))
	tong = 0
	for i in range(len(num)):
		tong = tong + num[i]
	if tong == m:
		ans.append('YES')
	else:
		ans.append('NO')
for i in range(len(ans)):
	print(ans[i])


for i in range(int(input())):
	m = int(input().split()[1])
	s = sum(map(int, input().split()))
	print('NO' if s != m else 'YES')


from sys import stdin, stdout
input = stdin.readline
from collections import defaultdict as dd
import math

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

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

def gets():
	return input()

def geta():
	return int(input())

def print_s(s):
	stdout.write(s + '\n')

def solve():
	for _ in range(geta()):
		(n, m) = geti()
		a = getl()
		if sum(a) == m:
			print('YES')
		else:
			print('NO')

def __starting_point():
	solve()
__starting_point()


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


def solve(n, m, arr):
	if sum(arr) == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(solve(n, m, arr))


import sys, math
from collections import defaultdict as dd
input = lambda : sys.stdin.readline().strip()
inp = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n, k) = inp()
	a = inp()
	print('YES' if sum(a) == k else 'NO')


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

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

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	(n, m) = li()
	l = sorted(li())
	print('YES' if sum(l) == m else 'NO')


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

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	(n, m) = read_ints()
	a = list(read_ints())
	print('YES' if sum(a) == m else 'NO')


for o in range(int(input())):
	(j, k) = list(map(int, input().split()))
	arr12 = list(map(int, input().split()))
	if sum(arr12) == k:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for w in range(t):
	(n, m) = (int(i) for i in input().split())
	l = [int(i) for i in input().split()]
	if m == sum(l):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, m) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')


x = int(input())
for number in range(0, x):
	first = input().split()
	bottom = int(first[0])
	goal = int(first[1])
	second = input().split()
	total = 0
	for i in range(0, len(second)):
		total = int(second[i]) / (i + 1) * (i + 1) + total
	if total == goal:
		print('YES')
	else:
		print('NO')


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


import sys
from io import IOBase, BytesIO
from os import read, write, fstat
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 = read(self._fd, max(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, size: int=...):
		while self.newlines == 0:
			b = read(self._fd, max(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:
			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')
(stdin, stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def split_input():
	return stdin.readline().split()

def _input():
	return stdin.readline()

def check_sum(arr, val):
	return sum(arr) == val
t = int(_input())
for _ in range(t):
	(_, value) = map(int, split_input())
	array = [int(x) for x in split_input()]
	ans = 'YES' if check_sum(array, value) else 'NO'
	stdout.write(ans + '\n')


import sys
import bisect as bi
import math as mt
import collections as cc
import heapq as hp
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n, m) = I()
	a = I()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


from sys import stdin

def main(n, m, a):
	print('YES' if sum(a) == m else 'NO')
t = int(stdin.readline())
cases = [([int(s) for s in stdin.readline().split()], [int(s) for s in stdin.readline().split()]) for _ in range(t)]
for ((n, m), a) in cases:
	main(n, m, a)


try:
	t = int(input())
	for _ in range(t):
		(a, b) = map(int, input().split())
		l = list(map(int, input().split()))
		if sum(l) == b:
			print('YES')
		else:
			print('NO')
except:
	pass


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


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	array = [int(x) for x in input().split()]
	if sum(array) == k:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	if sum(lis) == k:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	A = list(map(int, input().split()))
	arr = sorted(list(map(int, input().split())))
	if sum(arr) == A[1]:
		print('YES')
	else:
		print('NO')


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

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

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

def invr():
	return map(int, input().split())
for _ in range(inp()):
	sum = 0
	target = inlt()[1]
	for x in inlt():
		sum += x
	if sum == target:
		print('YES')
	else:
		print('NO')


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


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

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

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

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

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]

def debug(*args, c=6):
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=stderr)
for _ in range(I()):
	(n, m) = tup()
	ls = lint()
	if sum(ls) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	tc = input().split()
	inp = list(map(int, input().split()))
	if sum(inp) == int(tc[-1]):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, m) = [int(i) for i in input().rstrip().split(' ')]
	l = [int(i) for i in input().split(' ')]
	res = 'YES' if m == sum(l) else 'NO'
	print(res)


t = int(input())
for i in range(t):
	(n, m) = [int(j) for j in input().split()]
	if sum([int(j) for j in input().split()]) == m:
		print('YES')
	else:
		print('NO')


def f(x, m):
	n = len(x)
	total = 0
	for i in range(1, n + 1):
		for j in range(i, n + 1):
			total += x[j - 1] / j
	if round(total) == int(m):
		return 'YES'
	else:
		return 'NO'
t = int(input())
lists = []
answers = []
for i in range(t):
	nm = input().split()
	(n, m) = (int(nm[0]), int(nm[1]))
	ar = list(map(int, input().split()))
	answers.append(f(ar, m))
for answer in answers:
	print(answer)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(n, m) = inp()
	arr = list(inp())
	if sum(arr) == m:
		ans = 'YES'
	else:
		ans = 'NO'
	out(ans)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	data = [int(x) for x in input().split()]
	total = sum(data)
	if total == m:
		print('YES')
	else:
		print('NO')


def solve():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		return 'YES'
	return 'NO'
t = int(input())
i = 0
while i < t:
	print(solve())
	i += 1


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

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

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, sqrt, factorial, cos, tan, sin, radians, floor
import bisect
from decimal import *
getcontext().prec = 8
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def gcd1(a):
	if len(a) == 1:
		return a[0]
	ans = a[0]
	for i in range(1, len(a)):
		ans = gcd(ans, a[i])
	return ans

def main():
	for _ in range(ii()):
		(n, k) = mi()
		a = li()
		s = sum(a)
		if s == k:
			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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	S = sum(map(int, input().split()))
	print('YES' if S == m else 'NO')


import math
yes = 'YES'
no = 'NO'

def solve():
	(n, m) = map(int, input().split(' '))
	numbers = map(int, input().split(' '))
	return yes if sum(numbers) == m else no
for t in range(int(input())):
	print('{0}'.format(solve()))


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	s = 0
	for i in range(n):
		for j in range(i, n):
			s += a[j] / (j + 1)
	x = abs(m - s)
	print('YES' if x < 1e-06 else 'No')


import sys

def solve():
	(n, m) = map(int, input().split())
	n = sum([int(i) for i in input().split()])
	print('YES' if n == m else 'NO')
while True:
	line = sys.stdin.readline()
	if not line:
		break
	for cas in range(int(line)):
		solve()


t = int(input())
lst = []
blah = []
for _ in range(t):
	s = 0
	(n, m) = [int(x) for x in input().split()]
	blah = [int(x) for x in input().split()]
	for i in blah:
		s += i
	lst.append('YES' if s == m else 'NO')
for i in lst:
	print(i)


test_num = int(input())
result = []
for i in range(test_num):
	a = input()
	a = a.split()
	n = int(a[0])
	m = int(a[1])
	ar = input()
	array = [int(i) for i in ar.split()]
	if sum(array) == m:
		result.append('YES')
	else:
		result.append('NO')
for r in result:
	print(r)


for tc in range(int(input())):
	line = input().split()
	(n, m) = (int(line[0]), int(line[1]))
	line = input().split()
	summ = 0
	for i in range(n):
		summ += int(line[i])
	if summ == m:
		print('YES')
	else:
		print('NO')


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


a = int(input())
for i in range(0, a):
	(m, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr.sort()
	if sum(arr) == k:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

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

def inlt():
	return list(map(int, input().split()))
T = inp()
for _ in range(T):
	(n, m) = inlt()
	A = inlt()
	if sum(A) == m:
		print('YES')
	else:
		print('NO')


import math
import os
import random
import re
import sys
for _ in range(int(input())):
	(n, m) = map(int, input().rstrip().split())
	a = tuple(map(int, input().rstrip().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = [int(k) for k in input().split()]
	arr = [int(k) for k in input().split()]
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


from sys import stdin
t = int(stdin.readline().strip())
for _ in range(t):
	(n, m) = [int(x) for x in stdin.readline().strip().split(' ')]
	arr = [int(x) for x in stdin.readline().strip().split(' ')]
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('Yes')
	else:
		print('No')


t = int(input())
for i in range(0, t):
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	s = sum(l2)
	if s == l1[1]:
		print('YES')
	else:
		print('NO')


t = int(input())
answ = []
for i in range(0, t):
	(n, m) = map(int, input().split())
	a = []
	summ = 0
	for j in input().split():
		summ += int(j)
		a.append(int(j))
	if summ < m:
		answ.append('NO')
	elif summ == m:
		answ.append('YES')
	elif summ > m:
		answ.append('NO')
for i in answ:
	print(i)


from sys import stdin, stdout, setrecursionlimit

class Tail_Recursion_Optimization:

	def __init__(self, RECURSION_LIMIT, STACK_SIZE):
		setrecursionlimit(RECURSION_LIMIT)
		threading.stack_size(STACK_SIZE)
		return None

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		ans = []
		for i in range(int(R())):
			(n, m) = [int(x) for x in R().split()]
			a = [int(x) for x in R().split()]
			ans.append(['NO', 'YES'][sum(a) == m])
		W('\n'.join(ans))
		return 0

def main():
	s = SOLVE()
	s.solve()
main()


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	total = 0
	for i in range(n):
		total += (i + 1) * (arr[i] / (i + 1))
	ans = 'YES' if total == m else 'NO'
	print(ans)


N = int(input())
T = []
for i in range(N):
	L = list(map(int, input().split()))
	if sum(list(map(int, input().split()))) == L[1]:
		T.append('YES')
	else:
		T.append('NO')
for el in T:
	print(el)


I = lambda : map(int, input().split())
for i in range(int(input())):
	(n, m) = I()
	print('YES' if m == sum(I()) else 'NO')


t = int(input())
ans = []
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		ans.append('YES')
	else:
		ans.append('NO')
for el in ans:
	print(el)


import math
import sys
import itertools
import fractions
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in [wtf[i:i + 2] for i in range(1, len(wtf), 2)]:
	(n, m) = map(int, t[0].split())
	A = sorted(map(int, t[1].split()), reverse=True)
	print('YES' if sum(A) == m else 'NO')


t = int(input())
for _ in range(0, t):
	(n, m) = [int(j) for j in input().split()]
	a = [int(j) for j in input().split()]
	sum1 = 0
	for i in range(0, n):
		sum1 += a[i]
	if sum1 == m:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
from collections import *
from math import *
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	(n, m) = mp()
	l = li()
	s = sum(l)
	pr('YES' if s == m else 'NO')
for _ in range(inp()):
	solve()


import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
input = sys.stdin.readline
getS = lambda : input().strip()
getN = lambda : int(input())
getList = lambda : list(map(int, input().split()))
getZList = lambda : [int(x) - 1 for x in input().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)

def calc(arr, idx):
	ret = 0
	for i in range(len(arr)):
		if idx == 0:
			break
		if idx & 1:
			ret += arr[i]
		idx >>= 1
	return ret

def get_all_comb(arr):
	n = len(arr)
	ret = []
	for idx in range(1 << n):
		ret.append(calc(arr, idx))
	return ret

def solve():
	(n, m) = getList()
	li = getList()
	if sum(li) == m:
		print('YES')
	else:
		print('NO')
	return

def main():
	n = getN()
	for _ in range(n):
		solve()
	return
main()


import sys
import os
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')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	return [[default for j in range(m)] for i in range(n)]

def arr3D(n, m, r, default=0):
	return [[[default for k in range(r)] for j in range(m)] for i in range(n)]

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

class DSU:

	def __init__(self, length):
		self.length = length
		self.parent = [-1] * self.length

	def getParent(self, node, start):
		if node >= self.length:
			return False
		if self.parent[node] < 0:
			if start != node:
				self.parent[start] = node
			return node
		return self.getParent(self.parent[node], start)

	def union(self, node1, node2):
		parent1 = self.getParent(node1, node1)
		parent2 = self.getParent(node2, node2)
		if parent1 == parent2:
			return False
		elif self.parent[parent1] <= self.parent[parent2]:
			self.parent[parent1] += self.parent[parent2]
			self.parent[parent2] = parent1
		else:
			self.parent[parent2] += self.parent[parent1]
			self.parent[parent1] = parent2
		return True

	def getCount(self, node):
		return -self.parent[self.getParent(node, node)]

def solve(n, m, lst):
	if sum(lst) == m:
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	lst = list(map(int, input().split()))
	print(solve(n, m, lst))


import sys
test_cases = []
for (i, line) in enumerate(sys.stdin):
	if i == 0:
		t = int(line.strip())
	elif i % 2 != 0:
		a = line.strip().split()
		if len(a) > 1:
			n = int(a[0])
			m = int(a[1])
	else:
		arr = [int(i) for i in line.strip().split()]
		test_cases.append((m, n, arr))

def return_permutations(arr):
	permutations = []
	taken = [False] * len(arr)

	def backtrack(x):
		if len(x) == len(arr):
			permutations.append(arr)
		else:
			for i in range(len(arr)):
				if not taken[i]:
					taken[i] = True
					backtrack(x + [arr[i]])
					taken[i] = False
		return
	backtrack([])
	print(permutations)
	return permutations

def check_condition(test_cases):
	output = []
	for test in test_cases:
		(m, n, arr) = test
		if sum(arr) == m:
			output.append('Yes')
		else:
			output.append('No')
	return output
x = check_condition(test_cases)
for i in x:
	print(i)


import sys

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

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

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(n, m) = get_ints()
	array = get_array()
	s = 0
	for i in array:
		s += i
	if s == m:
		print('YES')
	else:
		print('NO')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(n, k) = sp()
	arr = l()
	out(('NO', 'YES')[sum(arr) == k])


import math
import sys
from collections import defaultdict, Counter
from functools import lru_cache
t = int(input())
for _ in range(t):
	(n, m) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	x = sum(arr)
	if x == m:
		print('YES')
	else:
		print('NO')


import array
T = int(input())
for Tid in range(T):
	(n, k) = map(int, input().split())
	a = array.array('i', map(int, input().split()))
	for i in range(n):
		k -= a[i]
	if k == 0:
		print('YES')
	else:
		print('NO')


import sys
from collections import deque
from copy import *
from itertools import permutations as prm, product

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def string(s):
	return ''.join(s)

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def bo(i):
	return ord(i) - ord('A')

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
while t > 0:
	t -= 1
	(n, m) = mi()
	a = li()
	print('YES' if sum(a) == m else 'NO')


def solve(arr, n, m):
	if sum(arr) == m:
		print('Yes')
	else:
		print('No')
n = int(input())
while n > 0:
	(x, y) = input().split()
	arr = list(map(int, input().split()))
	solve(arr, int(x), int(y))
	n -= 1


from sys import stdin, stdout
t = int(stdin.readline())
for i in range(t):
	(n, m) = list(map(int, stdin.readline().split()))
	arr = list(map(int, stdin.readline().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


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


R = lambda : map(int, input().split())
(t,) = R()
for _ in [0] * t:
	(n, m) = R()
	print('YNEOS'[sum(R()) != m::2])


from collections import *
from functools import *
import math
import sys
inp = sys.stdin.readline
out = sys.stdout.write

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

def li():
	return list(mi())

def ii():
	return int(inp())

def main():
	for _ in range(ii()):
		(n, m) = mi()
		a = li()
		if sum(a) == m:
			print('YES')
		else:
			print('NO')
main()


int_inp = lambda : int(input())
strng = lambda : input().strip()
strl = lambda : list(input().strip())
mul = lambda : map(int, input().split())
mulf = lambda : map(float, input().split())
seq = lambda : list(map(int, input().split()))
import math
from collections import Counter, defaultdict
for _ in range(int_inp()):
	(a, b) = mul()
	m = seq()
	if sum(m) == b:
		print('YES')
	else:
		print('NO')


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

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

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

def li():
	return [int(i) for i in 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=2):
	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):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	(n, m) = mi()
	a = li()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


for u in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = sum(l)
	if s == k:
		print('YES')
	else:
		print('NO')


i = lambda : [*map(int, input().split())]
for _ in range(int(input())):
	(n, m) = i()
	print('YNEOS'[sum(i()) != m::2])


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


for x in range(int(input())):
	(throw, goal) = [*map(int, input().split(' '))]
	nums = [*map(int, input().split(' '))]
	if sum(nums) == goal:
		print('YES')
	else:
		print('NO')


def sm(a, b, x, y, n):
	temp = a - x
	temp1 = min(temp, n)
	a = a - temp1
	n = n - temp1
	b = b - n
	return a * b
q = int(input())
for d in range(q):
	(n, m) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	sm = sum(a)
	if sm == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	(m, n) = map(int, input().split())
	arr = list(map(int, input().strip().split()))[:m]
	x = sum(arr)
	if x == n:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	arr = list(map(int, input().strip().split()))[:n]
	sum = 0
	for i in range(1, len(arr) + 1, +1):
		for j in range(i, len(arr) + 1, +1):
			sum = sum + arr[j - 1] / j
	if round(sum) == m:
		print('YES')
	else:
		print('NO')
	t = t - 1


def solve():
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	sum = 0
	for i in a:
		sum += i
	if sum == m:
		print('YES')
	else:
		print('NO')
t = int(input())
while t:
	solve()
	t -= 1


def solve():
	(n, m) = map(int, input().split())
	a = [int(s) for s in input().split()]
	s = sum(a)
	if m == s:
		return 'YES'
	return 'NO'

def main():
	t = int(input())
	results = []
	for _ in range(t):
		results.append(solve())
	for result in results:
		print(result)
main()


test = int(input())
for i in range(test):
	(number, masan) = map(int, input().split())
	lissst = list(map(int, input().split()))
	if sum(lissst) == masan:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(a, b) = [int(x) for x in input().split()]
	l = [int(x) for x in input().split()]
	if sum(l) == b:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
for i in range(t):
	L = []
	lt = []
	l = []
	s = 0
	L = input().split()
	m = int(L[1])
	lt = input().split()
	l = [int(j) for j in lt]
	s = sum(l)
	if m == s:
		print('YES')
	else:
		print('NO')


import sys, math
input = sys.stdin.readline
t = int(input())
for r in range(t):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
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')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == k:
		print('YES')
	else:
		print('NO')


for q in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	s = 0
	for i in range(n):
		for j in range(i, n):
			s += a[j] / (j + 1)
	print('YES' if abs(s - m) <= 0.1 else 'NO')


for i in range(int(input())):
	(m, n) = list(map(int, input().split(' ')))
	x = list(map(int, input().split(' ')))
	y = sorted(x)
	if sum(x) == n:
		print('YES')
	else:
		print('NO')


import sys
tcases = int(input())
for tc in range(tcases):
	(n, m) = input().split()
	arr = map(lambda e: int(e), input().split())
	if sum(arr) == int(m):
		print('YES')
	else:
		print('NO')


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


def solve(n, m):
	s = list(map(int, input().split()))
	if sum(s) == m:
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print(solve(n, m))


for _ in range(int(input())):
	(n, m) = [int(j) for j in input().split()]
	a = [int(j) for j in input().split()]
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for test_case in range(t):
	(n, m) = [int(x) for x in input().split()]
	a = [int(y) for y in input().split()]
	res = 0
	if sum(a) == m:
		res = 'YES'
	else:
		res = 'NO'
	print()
	print(res)
	print()


import sys

def rs():
	return sys.stdin.readline().rstrip()

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

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	(n, k) = ria()
	l = ria()
	ws('YES') if sum(l) == k else ws('NO')


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor
from bisect import bisect_right, bisect_left, bisect
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def sumDigits(no):
	return 0 if no == 0 else int(no % 10) + sumDigits(int(no / 10))
MOD = 1000000007
PMOD = 998244353
N = 10 ** 9 + 7
LOGN = 30
T = 1
T = int(stdin.readline())
for _ in range(T):
	(n, m) = list(map(int, stdin.readline().rstrip().split()))
	a = list(map(int, stdin.readline().rstrip().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
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())
t = inp()
for _ in range(t):
	(n, m) = invr()
	a = inara()
	tot = 0
	for num in a:
		tot += num
	if m == tot:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
import threading
import sys
import time

def get_int():
	return int(stdin.readline().strip())

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

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

def solve():
	(n, m) = get_tuple()
	ls = get_list()
	if sum(ls) == m:
		print('YES')
	else:
		print('NO')

def main():
	solve()
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


import sys
input = sys.stdin.readline

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

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

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

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

def solution():
	t = inp()
	for _ in range(t):
		(n, m) = inlt()
		a = inlt()
		solve(m, a)

def solve(m, a):
	if sum(a) == m:
		print('YES')
	else:
		print('NO')
solution()


import sys
import math
from collections import Counter, defaultdict
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()

def case():
	(n, m) = MAP()
	a = LI()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')
for _ in range(IN()):
	case()


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


t = int(input())
for j in range(t):
	a = input()
	b = a.split()
	n = int(b[0])
	m = int(b[1])
	c = input()
	l = c.split()
	for i in range(len(l)):
		l[i] = int(l[i])
	sum = 0
	for i in l:
		sum += i
	if sum == m:
		print('YES')
	else:
		print('NO')


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


t = input()
t = int(t)
l = [input().split() for i in range(2 * t)]
for i in range(0, 2 * t, 2):
	for j in range(2):
		l[i][j] = int(l[i][j])
	for k in range(l[i][0]):
		l[i + 1][k] = int(l[i + 1][k])
for i in range(0, 2 * t, 2):
	if sum(l[i + 1]) == l[i][1]:
		print('YES')
	else:
		print('NO')


import sys
t = int(input())
for tc in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	print('yes') if sum(a) == m else print('no')


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
t = ini()
for _ in range(t):
	(n, m) = inm()
	a = inl()
	print('YES' if sum(a) == m else 'NO')


for _ in range(int(input())):
	(_, s) = [int(x) for x in input().split()]
	nums = [int(x) for x in input().split()]
	if s == sum(nums):
		print('YES')
	else:
		print('NO')


def solve(n, m, a):
	for i in range(n):
		m -= a[i]
	if m:
		return 'NO'
	else:
		return 'YES'
t = int(input())
while t:
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	print(solve(n, m, a))
	t -= 1


for i in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	ovr = 0
	for i in range(n):
		ovr += arr[i] / (i + 1) * (i + 1)
	if ovr == m:
		print('YES')
	else:
		print('NO')


cases = int(input())
for case in range(cases):
	(_, m) = input().split()
	print('YES' if sum(map(int, input().split())) == int(m) else 'NO')


def fun(ls, t):
	if sum(ls) == t:
		print('YES')
	else:
		print('NO')
T = int(input())
for i in range(T):
	(n, t) = list(map(int, input().split()))
	ls = list(map(int, input().split()))
	fun(ls, t)


def solv():
	(x, y) = map(int, input().split())
	s = sum(list(map(int, input().split())))
	print('YES' if s == y else 'NO')
for n in range(int(input())):
	solv()


t = int(input())
while t:
	(size, maxval) = map(int, input().split())
	array = sorted(list(map(int, input().split())))
	revsum = 0
	sumval = 0
	for i in range(len(array)):
		sumval += array[i]
	if maxval == sumval:
		print('YES')
	else:
		print('NO')
	t = t - 1


for i in range(int(input())):
	(a, b) = map(int, input().split())
	(*c,) = map(int, input().split())
	print('YNEOS'[sum(c) != b::2])


def reorder():
	test_cases = int(input())
	for t in range(test_cases):
		(n, k) = [int(x) for x in input().split(' ')]
		el = [int(x) for x in input().split(' ')]
		if sum(el) == k:
			print('YES')
		else:
			print('NO')
reorder()


import sys
from math import gcd, sqrt, ceil, log2
from collections import defaultdict, Counter, deque
from bisect import bisect_left, bisect_right
import math
import heapq
from itertools import permutations
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 get_sum(bit, i):
	s = 0
	i += 1
	while i > 0:
		s += bit[i]
		i -= i & -i
	return s

def update(bit, n, i, v):
	i += 1
	while i <= n:
		bit[i] += v
		i += i & -i

def modInverse(b, m):
	g = math.gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def primeFactors(n):
	sa = set()
	sa.add(n)
	while n % 2 == 0:
		sa.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			sa.add(i)
			n = n // i
	return sa

def seive(n):
	pri = [True] * (n + 1)
	p = 2
	while p * p <= n:
		if pri[p] == True:
			for i in range(p * p, n + 1, p):
				pri[i] = False
		p += 1
	return pri

def check_prim(n):
	if n < 0:
		return False
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def getZarr(string, z):
	n = len(string)
	(l, r, k) = (0, 0, 0)
	for i in range(1, n):
		if i > r:
			(l, r) = (i, i)
			while r < n and string[r - l] == string[r]:
				r += 1
			z[i] = r - l
			r -= 1
		else:
			k = i - l
			if z[k] < r - i + 1:
				z[i] = z[k]
			else:
				l = i
				while r < n and string[r - l] == string[r]:
					r += 1
				z[i] = r - l
				r -= 1

def search(text, pattern):
	concat = pattern + '$' + text
	l = len(concat)
	z = [0] * l
	getZarr(concat, z)
	ha = []
	for i in range(l):
		if z[i] == len(pattern):
			ha.append(i - len(pattern) - 1)
	return ha

def mergeIntervals(arr):
	arr.sort(key=lambda x: x[0])
	m = []
	s = -10000
	max = -100000
	for i in range(len(arr)):
		a = arr[i]
		if a[0] > max:
			if i != 0:
				m.append([s, max])
			max = a[1]
			s = a[0]
		elif a[1] >= max:
			max = a[1]
	if max != -100000 and [s, max] not in m:
		m.append([s, max])
	return m
pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499]
seti = set(pr)
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	ans = 0
	for i in range(n):
		z = i + 1
		ans += z * (l[i] / z)
	if ans == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	(n, m) = [int(u) for u in input().split()]
	a = [int(s) for s in input().split()]
	b = sum(a)
	if b == m:
		s = 'YES'
	else:
		s = 'NO'
	print(s)


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	if sum(arr) == k:
		print('Yes')
	else:
		print('No')


import sys
import math
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = [int(x) for x in input().split()]
	if m == sum(l):
		print('YES')
	else:
		print('NO')


import math
teststring = '2\n3 8\n2 5 1\n4 4\n0 1 2 3\n'
online = 'Problem_A' not in __file__
(true, false) = (True, False)
if True:

	def spitout():
		for c in teststring.splitlines():
			yield c
	_ito = spitout()
	if not online:

		def input():
			return next(_ito)

	def build_enum(*a):
		built = dict()
		for (i, c) in enumerate(a):
			built[c] = i
		return lambda x: built[x]
T = int(input())
for _ in range(T):
	[n, m] = map(int, input().split(' '))
	a = []
	a.extend(map(int, input().split(' ')))
	s = 0
	for x in a:
		s += x
	if s == m:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
input = stdin.readline
print = lambda x: stdout.write(str(x) + '\n')
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


testCase = int(input())
while testCase > 0:
	nk = list(map(int, input().split()))
	array = list(map(int, input().split()))
	s = 0
	for ele in array:
		s = s + ele
	if s == nk[1]:
		print('YES')
	else:
		print('NO')
	testCase -= 1


import sys
import math
import itertools

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

def in1():
	return int(input())
for _ in range(in1()):
	(n, m) = get_line()
	a = get_line()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
for f in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()
for _ in range(II()):
	(n, m) = MI()
	aa = MI()
	if sum(aa) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, m) = map(int, input().split())
	arr = map(int, input().split())
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline

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

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

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

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

def main():
	try:
		for _ in range(inp()):
			(n, m) = invr()
			a = inlt()
			if sum(a) == m:
				print('YES')
			else:
				print('NO')
	except Exception as e:
		print(e)
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()


T = int(input())
for _ in range(0, T):
	(n, m) = map(int, input().split())
	s = [int(x) for x in input().split()]
	tot = 0
	for i in range(0, len(s)):
		tot += s[i]
	if tot == m:
		print('YES')
	else:
		print('NO')


import sys
from random import randint, shuffle
t = int(input())
for _ in range(t):
	(n, m) = list(map(int, input().split()))
	v = list(map(int, input().split()))
	if sum(v) == m:
		print('YES')
	else:
		print('NO')


ansl = []
x = int(input())
for i in range(x):
	(a, b) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == b:
		ansl.append('YES')
	else:
		ansl.append('NO')
for i in ansl:
	print(i)


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	(n, m) = mInt()
	a = lInt()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


test_case = int(input())
n = 0
m = 0
ans = []
for i in range(test_case):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		ans.append('YES')
	else:
		ans.append('NO')
print(*ans, sep='\n')


tests = int(input())
for test in range(tests):
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, v) = map(int, input().strip().split(' '))
	l = list(map(int, input().strip().split(' ')))
	val = sum(l)
	if val == v:
		print('YES')
	else:
		print('NO')


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
from collections import defaultdict
mod = 10 ** 9 + 7
mod1 = 998244353
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')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=300006, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater

class TrieNode:

	def __init__(self):
		self.children = [None] * 26
		self.isEndOfWord = False

class Trie:

	def __init__(self):
		self.root = self.getNode()

	def getNode(self):
		return TrieNode()

	def _charToIndex(self, ch):
		return ord(ch) - ord('a')

	def insert(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				pCrawl.children[index] = self.getNode()
			pCrawl = pCrawl.children[index]
		pCrawl.isEndOfWord = True

	def search(self, key):
		pCrawl = self.root
		length = len(key)
		for level in range(length):
			index = self._charToIndex(key[level])
			if not pCrawl.children[index]:
				return False
			pCrawl = pCrawl.children[index]
		return pCrawl != None and pCrawl.isEndOfWord

class Node:

	def __init__(self, data):
		self.data = data
		self.count = 0
		self.left = None
		self.right = None

class BinaryTrie:

	def __init__(self):
		self.root = Node(0)

	def insert(self, pre_xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = pre_xor & 1 << i
			if val:
				if not self.temp.right:
					self.temp.right = Node(0)
				self.temp = self.temp.right
				self.temp.count += 1
			if not val:
				if not self.temp.left:
					self.temp.left = Node(0)
				self.temp = self.temp.left
				self.temp.count += 1
		self.temp.data = pre_xor

	def query(self, xor):
		self.temp = self.root
		for i in range(31, -1, -1):
			val = xor & 1 << i
			if not val:
				if self.temp.left and self.temp.left.count > 0:
					self.temp = self.temp.left
				elif self.temp.right:
					self.temp = self.temp.right
			elif self.temp.right and self.temp.right.count > 0:
				self.temp = self.temp.right
			elif self.temp.left:
				self.temp = self.temp.left
			self.temp.count -= 1
		return xor ^ self.temp.data
for ik in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
import io
import os
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
for _ in range(inin()):
	(n, m) = cin()
	a = ain()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = [int(x) for x in input().split()]
	l = [int(x) for x in input().split()]
	s = 0
	for x in l:
		s += x
	if s == m:
		print('YES')
	else:
		print('NO')


import sys, collections, math

def in_out():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

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

def find(n):
	arr = []
	j = None
	for i in range(1, 10 ** 5 + 1):
		if not prime(i):
			arr.append(i)
		if len(arr) == n - 1:
			j = i + 1
			break
	while len(arr) != n:
		if not prime(j) and prime(sum(arr) + j):
			arr.append(j)
		j += 1
	return arr
t = int(input())
for i in range(t):
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from itertools import permutations, combinations

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
INF = 10 ** 9
mod = int(1000000000.0) + 7
for t in range(int(data())):
	(n, m) = mdata()
	if sum(mdata()) == m:
		out('YES')
	else:
		out('NO')


ans = []
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	u = list(map(int, input().split()))
	if sum(u) == m:
		ans.append('YES')
	else:
		ans.append('NO')
print(*ans, sep='\n')


t = int(input())
for x in range(t):
	(n, m) = [int(i) for i in input().split()]
	a = list(map(int, input().strip().split()))[:n]
	total = 0
	for ele in range(0, len(a)):
		total = total + a[ele]
	if total == m:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(n, t) = [int(x) for x in input().split()]
	nums = [int(x) for x in input().split()]
	if sum(nums) == t:
		print('YES')
	else:
		print('NO')


import sys, io, os
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.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(io.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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
T = int(input())
for _ in range(T):
	(N, M) = map(int, input().split())
	A = list(map(int, input().split()))
	if sum(A) == M:
		print('YES')
	else:
		print('NO')


def main():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')
rw = int(input())
for wewq in range(rw):
	main()


from sys import stdin, stdout
n = int(stdin.readline())
for i in range(n):
	(a, s) = map(int, stdin.readline().split())
	lst = [int(i) for i in stdin.readline().split()]
	if sum(lst) == s:
		ans = 'YES'
	else:
		ans = 'NO'
	stdout.write(ans + '\n')


try:
	t = int(input())
	while t:
		(n, m) = map(int, input().split())
		l = map(int, input().split())
		s = sum(l)
		if s == m:
			print('YES')
		else:
			print('NO')
except:
	pass


def main():
	(N, M) = map(int, input().split())
	(*A,) = map(int, input().split())
	if sum(A) == M:
		print('YES')
	else:
		print('NO')
for __ in [0] * int(input()):
	main()


for __ in range(int(input())):
	(n, m) = map(int, input().split())
	ar = list(map(int, input().split()))
	if sum(ar) == m:
		print('YES')
	else:
		print('NO')


h = int(input())
while h:
	(n, m) = map(int, input().split())
	s = 0
	lst = list(map(int, input().split()))
	lst.sort()
	for i in range(n):
		s += lst[i] / (i + 1) * (i + 1)
	if s == m:
		print('YES')
	else:
		print('NO')
	h -= 1


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	(n, m) = mints()
	s = sum(mints())
	if s == m:
		print('YES')
	else:
		print('NO')
for i in range(mint()):
	solve()


import math
for i in range(int(input())):
	(n, m) = list(map(int, input().split()))
	a = list(map(int, input().split()))[:n]
	s2 = sum(a)
	if m == int(s2):
		print('YES')
	else:
		print('NO')


from sys import stdin
for i in range(int(stdin.readline())):
	(n, m) = map(int, stdin.readline().strip().split())
	a = list(map(int, stdin.readline().strip().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
from math import *
inf = 10 ** 9
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = list(map(int, input().strip().split()))
	arr = list(map(int, input().strip().split()))
	s = sum(arr)
	if s == m:
		print('Yes')
	else:
		print('No')


nn = int(input())
res = []
for _ in range(nn):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == k:
		res.append('yes')
	else:
		res.append('no')
for i in res:
	print(i)


for _ in range(int(input())):
	(n, lent) = map(int, input().split())
	array = list(map(int, input().split()))
	if sum(array) == lent:
		print('YES')
	else:
		print('NO')


def panda(n, m, l):
	if sum(l) != m:
		return 'NO'
	return 'YES'
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	print(panda(n, m, l))


q = int(input())
for i in range(0, q):
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	s = 0
	for i in range(0, len(arr)):
		s += arr[i]
	if s == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	sum = 0
	for i in range(len(ar)):
		sum = sum + ar[i]
	if sum == k:
		print('YES')
	else:
		print('NO')


t = int(input())
for num in range(t):
	(n, m) = map(int, input().split())
	netsum = sum(map(int, input().split()))
	if netsum == m:
		print('YES')
	elif netsum != m:
		print('NO')


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from collections import Counter
from bisect import bisect_left
import sys
from queue import PriorityQueue
import operator as op
from functools import reduce
mod = 1000000007

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

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

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

def printIn(ob):
	return stdout.write(str(ob) + '\n')

def powerLL(n, p):
	result = 1
	while p:
		if p & 1:
			result = result * n % mod
		p = int(p / 2)
		n = n * n % mod
	return result

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def myCode():
	(n, m) = In()
	lst = L()
	if sum(lst) == m:
		print('YES')
	else:
		print('NO')

def main():
	for t in range(I()):
		myCode()
main()


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

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

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

def li():
	return list(mi())
t = int(input())
for _ in range(t):
	(n, m) = mi()
	a = li()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	(a, b) = [int(i) for i in input().split()]
	c = [int(i) for i in input().split()]
	if sum(c) == b:
		print('YES')
	else:
		print('NO')


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


t = int(input())
for x in range(t):
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	array = input().split()
	for i in range(len(array)):
		array[i] = int(array[i])
	if sum(array) == m:
		print('YES')
	else:
		print('NO')


import sys
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right
import math
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


def zip_sorted(a, b):
	(a, b) = zip(*sorted(zip(a, b)))
	sorted(zip(a, b), key=lambda x: x[1])
	return (a, b)
t = int(input())
for t1 in range(t):
	(n, m) = [int(n1) for n1 in input().split()]
	a = [int(n1) for n1 in input().split()]
	b = [0] * n
	sum1 = 0
	for i in range(len(a)):
		for j in range(i, len(a)):
			sum1 = sum1 + a[j] / (j + 1)
	if abs(sum1 - m) <= 10 ** (-6):
		print('YES')
	else:
		print('NO')


def reorder(arr, m):
	print('YES') if sum(arr) == m else print('NO')
test_case = input()
for i in range(0, int(test_case)):
	nm = input()
	(n, m) = (nm.split(' ')[0], nm.split(' ')[1])
	arr = input().split(' ')
	arr = list(map(lambda x: int(x), arr))
	reorder(arr, int(m))


import math
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	li = list(map(int, input().split()))
	if sum(li) == math.ceil(k):
		print('YES')
	else:
		print('NO')


from math import *
from random import *
from bisect import *
from math import *
for t in range(int(input())):
	(n, m) = map(int, input().split())
	if sum(map(int, input().split())) == m:
		print('YES')
	else:
		print('NO')


def result(m, arr):
	sum = 0
	for i in range(len(arr)):
		for j in range(i, len(arr)):
			sum += arr[j] / (j + 1)
	if round(sum) == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	r = result(m, arr)
	print(r)


T = int(input())
while T:
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	if sum(A) == m:
		print('YES')
	else:
		print('NO')
	T = T - 1


from collections import defaultdict
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


cases = int(input())
for c in range(cases):
	(n, m) = map(int, input().split())
	lst = list(map(int, input().split()))
	if sum(lst) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	sumi = 0
	for i in arr:
		sumi += i
	if sumi == m:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	total = 0
	for i in range(len(a)):
		for j in range(i, len(a)):
			total += a[j] / (j + 1)
	if round(total) == m:
		print('YES')
	else:
		print('NO')


import sys
for i in range(0, int(sys.stdin.readline())):
	if int(sys.stdin.readline().split()[1]) == sum(list(map(int, sys.stdin.readline().split()))):
		sys.stdout.write('YES\n')
	else:
		sys.stdout.write('NO\n')


def solve():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	if sum(a) == m:
		ans = 1
	if ans:
		print('YES')
	else:
		print('NO')

def main():
	for _ in range(int(input())):
		solve()
main()


outputs = []
test_cases = int(input())
for i in range(test_cases):
	m = list(map(int, input().split()))[1]
	if sum(list(map(int, input().split()))) == m:
		outputs.append('YES')
	else:
		outputs.append('NO')
for i in outputs:
	print(i)


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	sum1 = 0
	for i in range(1, n + 1):
		for j in range(i, n + 1):
			sum1 += arr[j - 1] / j
	if round(sum1) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	ar = list(map(int, input().split()))
	sum = 0
	for i in ar:
		sum += i
	if sum == m:
		print('YES')
	else:
		print('NO')


for ctr in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == k:
		print('YES')
	else:
		print('NO')


while True:
	try:
		t = eval(input())
		for i in range(t):
			(n, m) = map(int, input().split())
			a = list(map(int, input().split()))
			if sum(a) == m:
				print('YES')
			else:
				print('NO')
	except:
		break


ns = lambda : input()
ni = lambda : int(input())
nm = lambda : map(int, input().split())
nl = lambda : list(map(int, input().split()))
for _ in range(ni()):
	(n, m) = nm()
	a = nl()
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
n = int(stdin.readline())
for _ in range(n):
	list1 = []
	(t, val) = map(int, input().split())
	list1 = [int(x) for x in stdin.readline().split()]
	if sum(list1) == val:
		stdout.write('YES' + '\n')
	else:
		stdout.write('NO' + '\n')


from sys import stdin, exit
from bisect import bisect_left as bl, bisect_right as br
input = lambda : stdin.readline()[:-1]
intput = lambda : int(input())
sinput = lambda : input().split()
intsput = lambda : map(int, sinput())

def dprint(*args, **kwargs):
	if debugging:
		print(*args, **kwargs)
debugging = 1
t = intput()
for _ in range(t):
	(n, m) = intsput()
	a = list(intsput())
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from typing import List
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
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 RL():
	return map(int, sys.stdin.readline().rstrip().split())

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

def N():
	return int(input())

@lru_cache(None)
def fact(x):
	if x < 2:
		return 1
	return fact(x - 1) * x

@lru_cache(None)
def per(i, j):
	return fact(i) // fact(i - j)

@lru_cache(None)
def com(i, j):
	return per(i, j) // fact(j)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

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

def binfun(x):
	c = 0
	for w in arr:
		c += ceil(w / x)
	return c

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class smt:

	def __init__(self, l, r, arr):
		self.l = l
		self.r = r
		self.value = (1 << 31) - 1 if l < r else arr[l]
		mid = (l + r) // 2
		if l < r:
			self.left = smt(l, mid, arr)
			self.right = smt(mid + 1, r, arr)
			self.value &= self.left.value & self.right.value

	def setvalue(self, x, val):
		if self.l == self.r:
			self.value = val
			return
		mid = (self.l + self.r) // 2
		if x <= mid:
			self.left.setvalue(x, val)
		else:
			self.right.setvalue(x, val)
		self.value = self.left.value & self.right.value

	def ask(self, l, r):
		if l <= self.l and r >= self.r:
			return self.value
		val = (1 << 31) - 1
		mid = (self.l + self.r) // 2
		if l <= mid:
			val &= self.left.ask(l, r)
		if r > mid:
			val &= self.right.ask(l, r)
		return val

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] < self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d
t = N()
for i in range(t):
	(n, m) = RL()
	a = RLL()
	s = sum(a)
	ans = 'YES' if s == m else 'NO'
	print(ans)


for cnt in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	for x in l:
		m -= x
	if m == 0:
		print('YES')
	else:
		print('NO')


import sys
import math

class Solution:

	def __init__(self):
		pass

	def run(self):
		(n, m) = [int(x) for x in input().split()]
		a = [int(x) for x in input().split()]
		if sum(a) == m:
			return 'YES'
		else:
			return 'NO'
t = int(input())
s = Solution()
for i in range(t):
	print(s.run())


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	lista = list(map(int, input().split()))
	sum1 = 0
	for i in lista:
		sum1 += i
	if sum1 == m:
		print('YES')
	else:
		print('NO')


import math
from collections import deque
from sys import stdin, stdout, setrecursionlimit
from string import ascii_letters
letters = ascii_letters[:26]
from collections import defaultdict
input = stdin.readline
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print('YES' if sum(map(int, input().split())) == m else 'NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

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

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

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

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	(n, m) = read()
	a = get_list()
	if sum(a) == m:
		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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = scanner()
for i in range(t):
	solve()


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

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

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

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	(n, k) = RL()
	a = RLL()
	s = sum(a)
	if s == k:
		print('YES')
	else:
		print('NO')


def lis():
	return list(map(int, input().split()))
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	x = lis()
	if sum(x) != m:
		print('NO')
	else:
		print('YES')


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

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

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		(n, m) = ria()
		a = ria()
		c = sum(a)
		if m == c:
			print('YES')
		else:
			print('NO')
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import sys
sys.setrecursionlimit(10 ** 5 + 5)
from collections import defaultdict as dft, deque

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

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

def solve():
	(n, k) = mp()
	lst = ml()
	if sum(lst) == k:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	solve()


t = int(input())

def function(arr, m):
	N = len(arr)
	if sum(arr) == m:
		return 'YES'
	else:
		return 'NO'
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(function(arr, m))


import sys

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

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

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

def f(n, m, A):
	if sum(A) == m:
		return True
	return False
t = I()
for _ in range(t):
	(n, m) = MI()
	A = LI()
	if f(n, m, A):
		print('YES')
	else:
		print('NO')


import math
import sys
from collections import OrderedDict

class Graph:

	def __init__(self, Nodes, is_directed=False):
		self.nodes = Nodes
		self.adj_list = {}
		self.is_directed = is_directed
		for node in self.nodes:
			self.adj_list[node] = []

	def add_edge(self, u, v):
		self.adj_list[u].append(v)
		if self.is_directed == False:
			self.adj_list[v].append(u)

	def print_graph(self):
		for node in self.nodes:
			print(node, '->', self.adj_list[node])

	def degree_node(self, node):
		return len(self.adj_list[node])

	def dfsUTIL(self, v, visited, parents=[]):
		visited[v] = True
		for i in self.adj_list[v]:
			if visited[i] == False:
				self.dfsUTIL(i, visited, parents)
				parents.append(i)

	def dfs(self, v):
		visited = [False] * (max(self.adj_list) + 1)
		parents = [v]
		self.dfsUTIL(v, visited, parents)
		return parents

def factorial(n):
	if n == 0 or n == 1:
		return 1
	ans = 1
	for i in range(2, n + 1):
		ans *= i
	return ans

def dict_sort(ans):
	ans = sorted(ans.items(), reverse=True, key=lambda kv: kv[1])

def is_prime(n):
	if n == 1:
		return 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def seive_primes(n):
	flag = [0] * (n + 10)
	flag[1] = flag[0] = 1
	i = 2
	while i * i <= n + 1:
		if flag[i] == 0:
			j = i * i
			while j <= n + 1:
				flag[j] = 1
				j += i
		i += 1
	return flag

def factors(n):
	d = {}
	while n % 2 == 0:
		if 2 in d:
			d[2] += 1
		else:
			d[2] = 1
		n /= 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
			n /= i
	n = int(n)
	if n > 1:
		d[n] = 1
	return d

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

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

def alphabates():
	return 'abcdefghijklmnopqrstuvwxyz'

def binary_search(ls, n, flag):
	low = 0
	hi = n - 1
	while low <= hi:
		mid = (low + hi) // 2
		if ls[mid] == flag:
			return mid
		elif ls[mid] > flag:
			hi = mid - 1
		else:
			low = mid + 1
	return -1

def qdrt(a, b, c):
	chk = b * b - 4 * a * c
	if chk >= 0:
		ans1 = (-b + chk ** 0.5) / (2 * a)
		ans2 = (-b - chk ** 0.5) / (2 * a)
		return [int(ans1), int(ans2)]
	return -1

def permutation(n, r):
	if n < r:
		return 0
	ans = 1
	for i in range(n - r + 1, n + 1):
		ans *= i
	return ans

def combination(n, r):
	if n < r:
		return 0
	ans = 1
	for i in range(r):
		ans *= n - i
	div = 1
	for i in range(2, r + 1):
		div *= i
	return ans // div

def ispow2(n):
	ans = int(math.log(n, 2))
	if 2 ** ans == n:
		return True
	return False

def _2dmat(n):
	flag = [[i + 1 for i in range(n)]]
	for i in range(2, n + 1):
		new = []
		for j in range((i - 1) * n + 1, i * n + 1):
			new.append(j)
		flag.append(new)
	return flag

def sumn(n):
	return n * (n + 1) // 2

def arrinp():
	ls = list(map(int, input().split()))
	return ls

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

def main():
	(n, m) = mult_inp()
	ls = arrinp()
	if sum(ls) == m:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	main()


testcases = int(input())
for testcase in range(testcases):
	temparr = input()
	temparr = temparr.split()
	n = int(temparr[0])
	totalsum = int(temparr[1])
	temparr = input()
	temparr = temparr.split()
	arr = []
	for i in temparr:
		arr.append(int(i))
	if sum(arr) == totalsum:
		print('YES')
	else:
		print('NO')


t = int(input())
i = 0
while i < t:
	(n, m) = map(int, input().split())
	numberList = list(map(int, input().strip().split()))[:n]
	i += 1
	if m == sum(numberList):
		print('YES')
	else:
		print('NO')


def reorder(arr, val):
	if sum(arr) == val:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(l, val) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(reorder(arr, val))


def solve():
	(n, m) = [int(v) for v in input().split()]
	arr = [int(v) for v in input().split()]
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = [*map(int, input().split())]
	from functools import reduce
	from operator import mul
	denom = reduce(mul, [*range(1, n + 1)])
	numer = sum((a[i] * (i + 1) * (denom // (i + 1)) for i in range(n)))
	print('YES' if denom * m == numer else 'NO')


for j in range(int(input())):
	(n, m) = map(int, input().split())
	vals = list(map(int, input().split()))
	if sum(vals) == m:
		print('YES')
	else:
		print('NO')


def solve(arr, m):
	return sum(arr) == m
tests = int(input())
for t in range(tests):
	(_, m) = (int(i) for i in input().split(' '))
	arr = [int(i) for i in input().split(' ')]
	a = solve(arr, m)
	print('YES' if a else 'NO')


for _ in range(int(input())):
	(n, m) = (int(i) for i in input().split())
	summ = 0
	for i in input().split():
		summ += int(i)
	if summ == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(nums, sum_of_nums) = list(map(int, input().rstrip().split()))
	array = list(map(int, input().rstrip().split()))
	answer = 'YES' if sum_of_nums == sum(array) else 'NO'
	print(answer)


import sys
import math
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

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

def factors(n):
	step = 2 if n % 2 else 1
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(math.sqrt(n)) + 1, step) if n % i == 0)))

def comb(n, k):
	factn = math.factorial(n)
	factk = math.factorial(k)
	fact = math.factorial(n - k)
	ans = factn // (factk * fact)
	return ans

def is_prime(n):
	if n <= 1:
		return False
	if n == 2:
		return True
	if n > 2 and n % 2 == 0:
		return False
	max_div = math.floor(math.sqrt(n))
	for i in range(3, 1 + max_div, 2):
		if n % i == 0:
			return False
	return True
t = int(inputt())
for _ in range(t):
	(n, m) = map(int, inputt().split())
	li = listt()
	if sum(li) == m:
		print('YES')
	else:
		print('NO')


casos = int(input())
for h in range(casos):
	(n, m) = map(int, input().split())
	if sum(map(int, input().split())) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	if sum(arr) == k:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = [int(j) for j in input().split()]
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


for case in range(int(input())):
	(n, m) = map(int, input().split())
	sm = sum(map(int, input().split()))
	if sm == m:
		print('YES')
	else:
		print('NO')


def find(arr, m):
	if sum(arr) != m:
		print('NO')
	else:
		print('YES')
t = int(input())
for i in range(t):
	n_m = input().strip().split()
	(n, m) = (int(n_m[0]), int(n_m[1]))
	arr = list(map(int, input().strip().split()))
	find(arr, m)


from collections import defaultdict
import sys
import math as mt
import random
sys.setrecursionlimit(10 ** 6)

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

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

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(n, k) = get_ints()
	a = get_array()
	if sum(a) == k:
		print('YES')
	else:
		print('NO')


t = int(input())
while t != 0:
	nm = input().split()
	mm = input().split()
	for i in range(0, len(mm)):
		mm[i] = int(mm[i])
	ss = sum(mm)
	if ss == int(nm[1]):
		print('YES')
	else:
		print('NO')
	t -= 1


def main():
	for _ in range(int(input())):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		if sum(a) == k:
			print('YES')
		else:
			print('NO')
main()


from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
from itertools import *
import sys
input = sys.stdin.readline

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

def st():
	return input().rstrip('\n')

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

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	(n, m) = ma()
	a = lis()
	if sum(a) != m:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(n, target) = map(int, input().strip(' ').split(' '))
	arr = list(map(int, input().strip(' ').split(' ')))
	if sum(arr) == target:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	(n, m) = [int(I) for I in input().split()]
	A = [int(I) for I in input().split()]
	print(['YES', 'NO'][sum(A) != m])


t = int(input())
for p in range(t):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	lis = list(map(int, input().split()))
	s = 0
	for i in lis:
		s += i
	if s == b:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def OPS(ans):
	stdout.write(str(ans) + '\n')

def OPL(ans):
	[stdout.write(str(_) + ' ') for _ in ans]
	stdout.write('\n')
for _ in range(INI()):
	(n, m) = INL()
	A = INL()
	s = 0
	if sum(A) == m:
		OPS('YES')
	else:
		OPS('NO')


for i in range(int(input())):
	m = list(map(int, input().split()))
	k = sum(list(map(int, input().split())))
	if k == m[1]:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	s = 0
	arr = list(map(int, input().split()))
	arr.insert(0, arr[0])
	for i in range(1, n + 1):
		for j in range(i, n + 1):
			s = s + arr[j] / j
	s = round(s)
	if s == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	sum = 0
	for value in l:
		sum += value
	if sum == m:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for i in range(t):
	(n, m) = I()
	l = I()
	print('NYOE S'[sum(l) == m::2])


for _ in ' ' * int(input()):
	x = lambda : list(map(int, input().split()))
	(n, m) = x()
	print('YNEOS'[sum(x()) != m::2])


n = int(input())
for __ in range(n):
	(a, b) = map(int, input().split())
	arr = list(map(int, input().split()))
	print('YES' if b == sum(arr) else 'NO')


t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	l = [int(x) for x in input().split()]
	l.sort()
	s = 0
	for i in range(len(l)):
		s += l[i]
	if s == m:
		print('YES')
	else:
		print('NO')
	t = t - 1


t = int(input())
res = []
for i in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		res.append('YES')
	else:
		res.append('NO')
r = '\n'.join(res)
print(r)


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 update(bit, i):
	while i < len(bit):
		bit[i] += 1
		i += i & -i

def getsum(bit, i):
	res = 0
	while i > 0:
		res += bit[i]
		i -= i & -i
	return res
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, M, A):
	if sum(A) == M:
		return 'YES'
	return 'NO'
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N, M) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, M, A)
	print(ans)


for i in range(int(input())):
	(n, m) = map(int, input().split())
	a = map(int, input().split())
	print(['YES', 'NO'][sum(a) != m])


t = int(input())
while t > 0:
	count = 0
	(n, m) = map(str, input().split())
	a = list(map(str, input().split()))
	for i in a:
		count += int(i)
	if count == int(m):
		print('YES')
	else:
		print('NO')
	t -= 1


def reorder(values, m):
	total = 0
	for i in range(len(values)):
		total = total + values[i]
	if total == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	values = list(map(int, input().split()))
	print(reorder(values, m))


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


import os
from sys import stdin, stdout

def solve(tc):
	(n, m) = map(int, stdin.readline().split())
	seq = list(map(int, stdin.readline().split()))
	tot = 0
	for num in seq:
		tot += num
	print('YES' if tot == m else 'NO')
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


for t in [0] * int(input()):
	(n, m) = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	s = 0
	for i in range(n):
		for j in range(i, n):
			s += l[j] / (j + 1)
	if abs(s - m) <= 1e-06:
		print('YES')
	else:
		print('NO')


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

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()

def __starting_point():
	main()
__starting_point()


t = int(input())
for tc in range(t):
	(n, m) = [int(x) for x in input().split()]
	print('YES' if sum([int(x) for x in input().split()]) == m else 'NO')


from itertools import permutations
res = []

def fact(n):
	tot = 1
	for i in range(n):
		tot *= n
		n -= 1
	return tot
for _ in range(int(input())):
	(n, m) = list((int(i) for i in input().split()))
	arr = list((int(i) for i in input().split()))
	if sum(arr) == m:
		res.append('YES')
	else:
		res.append('NO')
for i in res:
	print(i)


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	sum = 0
	for i in range(1, 2):
		for j in range(0, n):
			sum += l[j] / i
	if sum == float(m):
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	s = list(map(int, input().split()))
	l = list(map(int, input().split()))
	if s[1] == sum(l):
		print('YES')
	else:
		print('NO')


import sys
t = int(sys.stdin.readline().strip())
for h in range(t):
	(n, m) = map(int, sys.stdin.readline().split())
	arr = list(map(int, sys.stdin.readline().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


tests = int(input())
for _ in range(tests):
	(n, m) = map(int, input().split())
	lst = [int(c) for c in input().split()]
	sm = sum(lst)
	if sm == m:
		print('YES')
	else:
		print('NO')


T = int(input())
while T:
	(n, m) = map(int, input().split())
	s = 0
	l = [int(k) for k in input().split()]
	s = sum(l)
	if s == m:
		print('YES')
	else:
		print('NO')
	T -= 1


for _ in range(int(input())):
	m = int(input().split()[1])
	sum1 = sum(map(int, input().split()))
	if m == sum1:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	if sum(A) == m:
		print('YES')
	else:
		print('NO')


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


for t in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	a = sorted(a)
	sm = sum(a)
	if sm == m:
		print('YES')
	else:
		print('NO')


import io
import os
import sys
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def printd(*args, **kwargs):
	print(*args, **kwargs)
	pass

def get_str():
	return input().decode().strip()

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

def oint():
	return int(input())
t = oint()
for _ in range(t):
	(n, m) = rint()
	a = list(rint())
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
mod = 10 ** 9 + 7
INF = float('inf')

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

def inpl():
	return list(map(int, sys.stdin.readline().split()))
for _ in range(inp()):
	(n, m) = inpl()
	a = inpl()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


from collections import Counter
import math
import sys
import heapq
from bisect import bisect, bisect_left, bisect_right

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

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	(n, m) = MAP()
	a = LIST()
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	b = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	f = 0
	for i in range(0, len(a)):
		f += a[i]
	if f == b[1]:
		print('YES')
	else:
		print('NO')


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


T = int(input())
for I in range(0, T):
	W = list(map(int, input().split(' ')))
	X = list(map(int, input().split(' ')))
	A = 0
	for J in X:
		A += J
	if A == W[1]:
		print('YES')
	else:
		print('NO')


def solve():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	s = 0
	for i in range(n):
		s += a[i]
	if s == m:
		print('YES')
	else:
		print('NO')
TC = int(input())
for _ in range(TC):
	solve()


t = int(input())
for time in range(t):
	lst = []
	a = []
	num = input()
	lst = num.split()
	n = lst[0]
	m = int(lst[1])
	number = input()
	a = number.split()
	sumation = 0
	for num in a:
		mynum = int(num)
		sumation += mynum
	if sumation == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for t1 in range(0, t):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	s = sum(l)
	if s == m:
		print('YES')
	else:
		print('NO')


from sys import stdin

class Input:

	def __init__(self):
		self.it = iter(stdin.readlines())

	def line(self):
		return next(self.it).strip()

	def array(self, sep=' ', cast=int):
		return list(map(cast, self.line().split(sep=sep)))

def testcases(unknown=False):
	inpt = Input()

	def testcases_decorator(func):
		(cases,) = [float('Inf')] if unknown else inpt.array()
		while cases > 0:
			try:
				func(inpt)
				cases -= 1
			except StopIteration:
				break
	return testcases_decorator

@testcases()
def solve(inpt):
	(n, m) = inpt.array()
	a = inpt.array()
	x = sum(a)
	print('YES' if x == m else 'NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	L = map(int, input().split())
	if sum(L) == m:
		print('YES')
	else:
		print('NO')


import sys

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

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

def get_string():
	return sys.stdin.readline().strip()

def get_int():
	return int(sys.stdin.readline().strip())
from sys import maxsize

def solve():
	for _ in range(get_int()):
		(n, m) = get_ints()
		arr = get_list()
		if sum(arr) == m:
			print('YES')
		else:
			print('NO')
solve()


def testcase():
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')
	return
import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
sys.setrecursionlimit(10 ** 5)
t = int(input())
for _ in range(t):
	testcase()


t = int(input())
num = list()
array = list()
for j in range(t):
	num.append(list(map(int, input().split())))
	array.append(list(map(int, input().split())))
for j in range(t):
	if sum(array[j]) == num[j][1]:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline

def solution():
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	solution()


import sys
input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
import itertools

class Solution:

	def solve(self, mylist, m):
		if sum(mylist) == m:
			return 'YES'
		return 'NO'
n = inp()
A = Solution()
for i in range(n):
	(_, m) = invr()
	mylist = inlt()
	ans = A.solve(mylist, m)
	print(ans)


def problem_sol(x, m):
	if sum(x) == m:
		print('YES')
	else:
		print('NO')
tests = int(input())
while tests > 0:
	(n, m) = map(int, input().split())
	x = list(map(int, input().split()))
	problem_sol(x, m)
	tests -= 1


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

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

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

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

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

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

def comb(n, r):
	if n < r:
		return 0
	else:
		return fac[n] * (finv[r] * finv[n - r] % mod) % mod

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def yes():
	print('Yes')

def no():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')

def solve():
	(n, m) = sep()
	ar = lis()
	if sum(ar) == m:
		YES()
	else:
		NO()
testcase(int(inp()))


for t in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	summ = 0
	s2 = 0
	for i in range(0, n):
		summ += arr[i]
	if summ == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	s = 0
	for num in a:
		s += num
	if s == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	chisla = input().split()
	a = []
	for j in range(len(chisla)):
		a.append(int(chisla[j]))
	s = 0
	for k in range(len(chisla)):
		s += int(chisla[k])
	if s == m:
		print('YES')
	else:
		print('NO')


def sumo(l, n):
	if sum(l) == n:
		return 'YES'
	else:
		return 'NO'
for _ in range(int(input())):
	(length, m) = map(int, input().split())
	array = list(map(int, input().split()))
	print(sumo(array, m))


import typing
import sys
import math
import collections
import bisect
import itertools
import heapq
import decimal
INF = 10 ** 20
MOD = 10 ** 9 + 7

def ni():
	return int(sys.stdin.buffer.readline())

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

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

def main():
	t = ni()
	for _ in range(t):
		(n, m) = ns()
		a = na()
		print('YES' if sum(a) == m else 'NO')
main()


for test in range(int(input())):
	(n, m) = map(int, input().split())
	tot = sum(map(int, input().split()))
	print('YES' if tot == m else 'NO')


t = int(input())
for t_qtr in range(t):
	nk = input().split()
	n = int(nk[0])
	k = int(nk[1])
	s = list(map(int, input().rstrip().rsplit()))
	a = sum(s)
	if a == k:
		print('YES')
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline

def solve():
	(n, m) = map(int, input().split())
	L = list(map(int, input().split()))
	ans = 0
	for i in range(1, n + 1):
		for j in range(i, n + 1):
			ans += L[j - 1] / j
	if round(ans) == m:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	solve()


t = int(input())
while t > 0:
	t = t - 1
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		print('Yes')
	else:
		print('No')


from sys import stdin
t = int(stdin.readline())
print_me = []
for _ in range(t):
	(_, m) = map(int, stdin.readline().split())
	A = [int(x) for x in stdin.readline().strip().split()]
	if sum(A) == m:
		print_me.append('YES')
	else:
		print_me.append('NO')
print('\n'.join(print_me))


import sys

def solve(n, m, arr):
	if sum(arr) == m:
		return 'YES'
	return 'NO'

def readinput():
	tc = int(sys.stdin.readline().rstrip())
	for _ in range(tc):
		(n, m) = map(int, sys.stdin.readline().rstrip().split(' '))
		arr = list(map(int, sys.stdin.readline().rstrip().split(' ')))
		print(solve(n, m, arr))
readinput()


import sys
from collections import defaultdict
input = sys.stdin.readline
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	lis = list(map(int, input().split()))
	if sum(lis) == m:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	res = 0
	res = sum(lis)
	if res == k:
		print('YES')
	else:
		print('NO')
	t -= 1


import sys, math, cmath, time
start_time = time.time()

def solve():
	(n, m) = invr()
	print('YES' if sum(inlt()) == m else 'NO')

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(1, t + 1):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

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

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

def insr():
	return input().strip()

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

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def factorial(n, m=1000000007):
	q = 1
	for i in range(n):
		q = q * (i + 1) % m
	return q

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

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b

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

def ceil(a, b):
	return -(-a // b)

def seive(n):
	a = [1]
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	return a
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


x = int(input())
for h in range(0, x):
	(n, m) = [int(a) for a in input().split()]
	ar = list(map(int, input().split()))[:n]
	d = sum(ar)
	if d == m:
		print('YES')
	else:
		print('NO')


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


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def get_input(a=str):
	return a(input())

def get_int_input():
	return get_input(int)

def get_input_arr(a):
	return list(map(a, input().split()))

def get_int_input_arr():
	return get_input_arr(int)

def solve():
	t = get_int_input()
	for _ in range(t):
		(n, m) = get_int_input_arr()
		arr = get_int_input_arr()
		if m == sum(arr):
			cout << 'YES' << endl
		else:
			cout << 'NO' << endl

def main():
	solve()
main()


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')
	t -= 1


def CalcWeightSum(array):
	s = 0
	for i in range(len(array)):
		for j in range(i):
			s += float(array[j] / (j + 1))
	return s
T = int(input())
for t in range(T):
	(N, M) = [int(i) for i in input().split()]
	array = [int(i) for i in input().split()]
	if sum(array) == M:
		print('YES')
	else:
		print('NO')


t = int(input())
for m in range(t):
	(a, b) = map(int, input().split())
	li = list(map(int, input().split()))
	s = sum(li)
	if s == b:
		print('YES')
	else:
		print('NO')


p = lambda : list(map(int, input().split()))
for _ in '.' * p()[0]:
	print('YNEOS'[p()[1] != sum(p())::2])


testes = int(input())
for counter in range(testes):
	many = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	if sum(arr) == many[1]:
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(t):
	n1 = input()
	(n, m) = n1.split(' ')
	m = int(m)
	arr = input()
	l1 = arr.split(' ')
	l1.sort()
	sum = 0
	for i in range(len(l1)):
		sum = sum + int(l1[i])
	if m == sum:
		print('YES')
	else:
		print('NO')


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


def cal(n, m, arr):
	if sum(arr) == m:
		return 'YES'
	return 'NO'
t = int(input())
while t:
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(cal(n, m, arr))
	t -= 1


def solve():
	(n, m) = (int(x) for x in input().strip().split())
	a = (int(x) for x in input().strip().split())
	if sum(a) == m:
		return 'YES'
	return 'NO'
for _ in range(int(input().strip())):
	print(solve())


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	s = sum(list(map(int, input().split())))
	print(('NO', 'YES')[x == s])


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

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

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

def invr():
	return map(int, input().split())
n = inp()
for _ in range(n):
	l = inlt()
	m = l[1]
	l = inlt()
	if m == sum(l):
		print('YES')
	else:
		print('NO')


def inputt():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	(n, m) = inputt()
	summ = 0
	arr = inputt()
	for x in arr:
		summ += x
	if summ == m:
		print('YES')
	else:
		print('NO')


d = int(input())
for i in range(d):
	(quantityArray, ownCount) = map(int, input().split())
	array = list(map(int, input().split()))
	summa = 0
	for i in range(0, quantityArray):
		summa = summa + array[i]
	if summa == ownCount:
		print('YES')
	else:
		print('NO')


t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	m = int(l[1])
	l = input().split()
	li = [int(i) for i in l]
	z = sum(li)
	if z == m:
		print('YES')
	else:
		print('NO')


from sys import stdin
input = stdin.readline

def A():
	t = int(input())
	for __ in range(t):
		(n, m) = map(int, input().split())
		a = list(map(int, input().split()))
		if sum(a) == m:
			print('YES')
		else:
			print('NO')

def B():
	t = int(input())
	for __ in range(t):
		_ = 0

def C():
	t = int(input())
	for __ in range(t):
		_ = 0

def D():
	t = int(input())
	for __ in range(t):
		_ = 0
A()


t = input()
rpta = []
for k in range(int(t)):
	(n, m) = input().split()
	a = input().split()
	a_i = [int(x) for x in a]
	suma = sum(a_i)
	if suma == int(m):
		rpta.append('YES')
	else:
		rpta.append('NO')
for j in rpta:
	print(j)


def main():
	t = int(input())
	while t > 0:
		(n, m) = map(int, input().split())
		li = list(map(int, input().split()))
		sum = 0
		for j in li:
			sum = sum + j
		if sum == m:
			print('YES')
		else:
			print('NO')
		t = t - 1
main()


n = int(input())
for _ in range(n):
	(_, m) = tuple(map(int, input().split()))
	items = tuple(map(int, input().split()))
	if m == sum(items):
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	a = input().split(' ')
	m = int(a[1])
	l = [int(n) for n in input().split(' ')]
	s = sum(l)
	if s == m:
		print('YES')
	else:
		print('NO')


from typing import List

def solve(n: int, m: int, a: List[int]):
	return sum(a) == m
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	r = solve(n, m, a)
	if r:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if sum(map(int, input().split())) == m:
		print('YES')
		continue
	print('NO')


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]
from sys import stdin, stdout, setrecursionlimit
from math import ceil, factorial as fact
from heapq import *

def sol():
	(n, m) = rrm()
	nums = rrm()
	x = sum(nums)
	if x == m:
		print('YES')
	else:
		print('NO')
	return

def main():
	T = rri()
	for t in range(1, T + 1):
		ans = sol()
main()


T = int(input())
for tt in range(1, T + 1):
	(N, S) = map(int, input().split())
	arr = map(int, input().split())
	if sum(arr) == S:
		print('YES')
		continue
	print('NO')


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	(n, m) = I()
	a = list(I())
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


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


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


a = int(input())
res = []
for i in range(0, a):
	(n, m) = input().split(' ')
	n = int(n)
	m = int(m)
	input_arr = list(map(int, input().split(' ')))
	sum_of_array = sum(input_arr)
	if sum_of_array == m:
		res.append('YES')
	else:
		res.append('NO')
for i in res:
	print(i)


R = lambda : map(int, input().split())
for _ in range(int(input())):
	(n, m) = R()
	arr = list(R())
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


import itertools
import math
import sys
import os
from collections import defaultdict

def is_debug():
	return 'PYPY3_HOME' not in os.environ

def stdin_wrapper():
	data = '2\n3 8\n2 5 1\n4 4\n0 1 2 3\n'
	for line in data.split('\n'):
		yield line
if not is_debug():

	def stdin_wrapper():
		while True:
			yield sys.stdin.readline()
inputs = stdin_wrapper()

def input_wrapper():
	return next(inputs)

def get_str():
	if is_debug():
		return input_wrapper()
	return input()

def get(_type):
	if _type == str:
		return get_str()
	return _type(input_wrapper())

def get_arr(_type):
	return [_type(x) for x in input_wrapper().split()]

def tuplerize(method):

	def wrap(*args, **kwargs):
		res = method(*args, **kwargs)
		if not isinstance(res, (tuple, list)):
			res = (res,)
		return res
	return wrap

@tuplerize
def solve(m, d):
	return 'YES' if m == sum(d) else 'NO'
t = get(int)
for _ in range(t):
	(n, m) = get_arr(int)
	d = get_arr(int)
	print(*solve(m, d))


for _ in range(int(input())):
	(n, s) = list((int(i) for i in input().split()))
	A = list((int(i) for i in input().split()))
	if sum(A) == s:
		print('YES')
	else:
		print('NO')


import math
from collections import Counter, defaultdict, deque

def f(n, m, a):
	if sum(a) == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
result = []
for i in range(t):
	(n, m) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	result.append(f(n, m, a))
for i in range(t):
	print(result[i])


from functools import reduce
import os
import sys
from collections import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
inf = 1e+18
div = 998244353
for _ in range(inn()):
	(n, m) = value()
	a = arr()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import math
import os
import random
import re
import sys

def solve():
	t = int(input())
	for _ in range(t):
		(n, m) = list(map(int, input().split()))
		xs = list(map(int, input().split()))
		if sum(xs) == m:
			print('YES')
		else:
			print('NO')
result = solve()


from sys import stdin, stdout
from math import factorial as f
from random import randint
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if sum(map(int, input().split())) == m:
		print('YES')
	else:
		print('NO')


import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List
sys.setrecursionlimit(99999)
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	s = sum(arr)
	if s == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n1, m1) = map(int, input().split())
	l1 = list(map(int, input().split()))
	if sum(l1) == m1:
		print('YES')
	else:
		print('NO')


n = int(input())
z = []
for i in range(n):
	arr = list(map(int, input().rstrip().split()))
	k = arr[0]
	l = arr[1]
	arr1 = list(map(int, input().rstrip().split()))
	arr1 = sorted(arr1)
	if sum(arr1) == l:
		z.append('YES')
	else:
		z.append('NO')
for i in z:
	print(i)


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


import sys
t = int(input().strip())
for a0 in range(t):
	l1 = [int(i) for i in input().split()]
	n = l1[0]
	k = l1[1]
	l = [int(i) for i in input().split()]
	count = 0
	for i in l:
		count += i
	if count == k:
		print('YES')
	else:
		print('NO')


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


for t in range(int(input())):
	(n, m) = [int(a) for a in input().split()]
	if m == sum([int(a) for a in input().split()]):
		print('YES')
	else:
		print('NO')


def solve(n, m, arr):
	tot = sum(arr)
	if tot == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(n, m) = (int(j) for j in input().split())
	arr = [int(k) for k in input().split()]
	print(solve(n, m, arr))


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = inar()
		arr = inar()
		if sum(arr) == k:
			print('YES')
		else:
			print('NO')
main()


import os
import sys
from io import BytesIO, IOBase
import math
from itertools import permutations
from decimal import *
getcontext().prec = 25
MOD = pow(10, 9) + 7
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')
for i in range(int(input())):
	(n, k) = map(int, input().split(' '))
	l = list(map(int, input().split(' ')))
	if sum(l) == k:
		print('YES')
	else:
		print('NO')


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


import sys

def input():
	return sys.stdin.readline().rstrip()
t = int(input())
for i in range(t):
	[n, m] = list(map(int, input().split()))
	arr_inp = list(map(int, input().split()))
	if sum(arr_inp) == m:
		print('YES')
	else:
		print('NO')


from math import *
from sys import *
t = int(stdin.readline())
for _ in range(t):
	(n, k) = map(int, stdin.readline().split())
	a = list(map(int, stdin.readline().split()))
	if sum(a) == k:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(dlug, m) = map(int, input().split())
	liczby = list(map(int, input().split()))
	if sum(liczby) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	su = 0
	(n, m) = map(int, input().split())
	l = sorted(list(map(int, input().split())))
	su = sum(l)
	if int(su) == m:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	nm = list(map(int, input().split()))
	n = nm[0]
	m = nm[1]
	li = list(map(int, input().split()))
	if sum(li) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	tr = int(input().split()[1])
	if sum(map(int, input().split())) == tr:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(0, n):
	(p, q) = map(int, input().split())
	l = list(map(int, input().split()))
	if q == sum(l):
		print('YES')
	else:
		print('NO')


numTestCases = int(input())
testCases = []
for i in range(0, numTestCases):
	[n, m] = list(map(int, input().split()))
	t = sum(list(map(int, input().split()))) == m
	testCases.append(t)
for i in testCases:
	if i:
		print('YES')
	else:
		print('NO')


for k in range(int(input())):
	(n, m) = map(int, input().split())
	l = [int(num) for num in input().split()]
	s = sum(l)
	if s == m:
		print('YES')
	else:
		print('NO')


am = int(input())
array = list()
ms = list()
for i in range(am):
	(n, m) = list(map(int, input().split()))
	ms.append(m)
	array.append(list(map(int, input().split())))
for i in range(am):
	if sum(array[i]) == ms[i]:
		print('YES')
	else:
		print('NO')


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	(n, s) = map(int, input().split())
	l = list(map(int, input().split()))
	if sum(l) == s:
		print('YES')
	else:
		print('NO')
for t in range(int(input())):
	solve()


def func():
	t = int(input())
	for _ in range(t):
		(n, m) = map(int, input().strip().split())
		lst = sum(map(int, input().strip().split()))
		print('YES' if lst == m else 'NO')
func()


T = int(input())
for case in range(T):
	(n, m) = [int(i) for i in input().split(' ')]
	arr = [int(i) for i in input().split(' ')]
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


def solve(n, k, a):
	if sum(a) == k:
		print('YES')
	else:
		print('NO')
noOfTestCases = int(input())
for i in range(noOfTestCases):
	(l, r) = map(int, input().split())
	a = list(map(int, input().split()))
	solve(l, r, a)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(n, val) = map(int, stdin.readline().split())
	nums = [int(x) for x in stdin.readline().split()]
	if val == sum(nums):
		print('YES')
	else:
		print('NO')


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


for i in range(int(input())):
	(a, b) = map(int, input().split())
	case = []
	for i in map(int, input().split()):
		case.append(i)
	if sum(case) == b:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	lista = input().split()
	suma = 0
	for i in lista:
		suma += int(i)
	if suma == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	target = list(map(int, input().split()))
	numbers = list(map(int, input().split()))
	iterations = target[0]
	final_target = target[1]
	sum_ = sum(numbers)
	if sum_ == final_target:
		print('YES')
	else:
		print('NO')


import math
import sys, bisect
from heapq import *
from itertools import *
from collections import *
sys.setrecursionlimit(10 ** 6)
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))
for _ in range(I()):
	(n, m) = neo()
	A = Neo()
	if sum(A) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	count = 0
	for i in l:
		count += i
	if count == m:
		print('Yes')
	else:
		print('No')


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

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

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

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * (2 * 10 ** 5 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(2 * 10 ** 5 + 5):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj
mod = 10 ** 9 + 7

def solve():
	(n, m) = IP()
	a = L()
	if sum(a) == m:
		print('YES')
	else:
		print('NO')
	return
t = II()
for i in range(t):
	solve()


k = int(input())
a = []
for i in range(k):
	(n, m) = map(int, input().split())
	b = list(map(int, input().split()))
	x = sum(b)
	if x == m:
		x = 'YES'
	else:
		x = 'NO'
	a.append(x)
for i in a:
	print(i)


t = int(input())
for i in range(t):
	m = int(input().split(' ')[1])
	arr = sum((int(num) for num in input().split(' ')))
	if not arr - m:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def solve():
	(n, m) = map(int, input().split())
	L = list(map(int, input().split()))
	if sum(L) == m:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = map(int, input().split())
	res = 'NO' if sum(arr) != m else 'YES'
	print(res)


def reorder(arr, k):
	return sum(arr) == k
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	print('YES' if reorder(arr, k) else 'NO')


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

def str(x=b''):
	return x if type(x) is bytes else _str(x).encode()

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

def inp():
	return sys.stdin.readline().rstrip()

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

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

def main():
	(n, m) = mpint()
	return sum(mpint()) == m
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
for _ in range(itg()):
	print('YES' if main() else 'NO')


t = int(input())
for _ in range(t):
	res = 0
	(n, m) = map(int, input().split())
	per = [int(i) for i in input().split()]
	for i in range(len(per)):
		res += per[i] / (i + 1) * (i + 1)
	if m == int(res):
		print('YES')
	else:
		print('NO')


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 list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	(n, m) = Ri()
	a = Ri()
	if sum(a) == m:
		YES()
	else:
		NO()


T = int(input())
for t in range(T):
	(n, m) = [int(i) for i in input().split()]
	A = sum([int(i) for i in input().split()])
	if A == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	li = list(map(int, input().split()))
	li.sort()
	s = 0
	for i in range(len(li)):
		for j in range(i, len(li)):
			s += li[j] / (j + 1)
	if round(s) == m:
		print('YES')
	else:
		print('NO')


t = int(input())

def q(m, s):
	if m == s:
		return 'YES'
	else:
		return 'NO'
for i in range(t):
	j = input().split()
	(n, m) = (int(j[0]), int(j[1]))
	k = input().split()
	l = list(map(int, k))
	s = sum(l)
	print(q(m, s))


t = int(input())
for _ in range(t):
	nm = input().split()
	n = int(nm[0])
	m = int(nm[1])
	arr = list(map(int, input().split()))
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	st = input().split()
	n = int(st[0])
	m = int(st[1])
	st = input().split()
	s = 0
	for i in range(n):
		s += int(st[i])
	if s == m:
		print('YES')
	else:
		print('NO')


test = int(input())
from copy import deepcopy
from collections import deque
import math as ma
for _ in range(test):
	(n, m) = map(int, input().split())
	ls = list(map(int, input().split()))
	if sum(ls) == m:
		print('YES')
	else:
		print('NO')


import sys
from collections import defaultdict
from sys import maxsize

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

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

def li():
	return list(map(int, sys.stdin.readline().strip().split()))
for i in range(ini()):
	(n, m) = inp()
	l = li()
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


inp = lambda : int(input())
strl = lambda : list(input().strip())
seq = lambda : list(map(int, input().strip().split()))

def f(arr, nm):
	(n, m) = (nm[0], nm[1])
	if sum(arr) == m:
		return 'YES'
	return 'NO'

def main():
	t = inp()
	for _ in range(t):
		nm = seq()
		a = seq()
		result = f(a, nm)
		print(result)
main()


for _ in range(int(input())):
	x = 0
	(n, m) = map(int, input().split())
	for i in input().split():
		x = x + int(i)
	if m == x:
		print('YES')
	else:
		print('NO')


def solve():
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')
	return
t = int(input())
for i in range(t):
	solve()


import sys
input = sys.stdin.readline

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

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

def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		a = list(map(int, input().split()))
		if sum(a) == m:
			print('YES')
		else:
			print('NO')
	return
main()


t = int(input())
g = lambda : map(int, input().split())
while t:
	t -= 1
	(n, m) = g()
	arr = list(g())
	print('YNEOS'[1 - (sum(arr) == m)::2])


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

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

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

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		(n, k) = In()
		l = list(In())
		if sum(l) == k:
			yes()
		else:
			no()
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


test_cases = int(input())
for _ in range(test_cases):
	(arr_size, target) = map(int, input().split())
	arr = list(map(int, input().split()))
	if sum(arr) == target:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	x = list(map(int, input().split()))
	sol = sum(x)
	if sol == m:
		print('YES')
	if sol != m:
		print('NO')


t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	my = list(map(int, input().split()))
	cal = 0
	for i in my:
		cal += i
	if cal == m:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
for i in range(t):
	(n, m) = [int(i) for i in input().split()]
	list_a = [int(i) for i in input().split()]
	sum_a = sum(list_a)
	if sum_a == m:
		print('YES')
	else:
		print('NO')


import bisect

def solve(a, s):
	if sum(s) == b:
		return 'YES'
	else:
		return 'NO'
	pass
t = int(input())
ans = []
for i in range(t):
	arr = [int(x) for x in input().split()]
	a = arr[0]
	b = arr[1]
	s = [int(x) for x in input().split()]
	ans.append(solve(b, s))
for test in ans:
	print(test)


def solve():
	(n, m) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')
	return

def main():
	t = int(input())
	for i in range(t):
		solve()
	return

def __starting_point():
	main()
__starting_point()


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
import collections as col
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	(N, M) = getInts()
	A = getInts()
	return 'YES' if sum(A) == M else 'NO'
for _ in range(getInt()):
	print(solve())


tests = int(input())
for _ in range(tests):
	(n, s) = map(int, input().split())
	actual = sum(map(int, input().split()))
	print('YES' if actual == s else 'NO')


T = int(input())
for _ in range(T):
	(N, M) = map(int, input().split())
	A = list(map(int, input().split()))
	A.sort()
	p = 1
	for i in range(N, 1, -1):
		p *= i
	s = 0
	for i in range(N):
		for j in range(i, N):
			s += A[j] * (p // (j + 1))
	if s == M * p:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(_, m) = map(int, input().split())
		s = sum(map(int, input().split()))
		print('Yes' if s == m else 'No')
main()


for i in range(int(input())):
	(a, b) = [list(map(int, input().split())) for i in range(2)][0:2]
	if sum(b) == a[1]:
		print('Yes')
	else:
		print('No')


import itertools
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	nums = sorted(list(map(int, input().split())))
	s = sum(nums)
	if s == m:
		print('YES')
		continue
	else:
		print('NO')
		continue
	print(s)
	s = 0
	for i in range(n - 1, -1, -1):
		for k in range(i, -1, -1):
			s += nums[k] / (k + 1)
	if s == m:
		print('YES')
		continue
	elif s > m:
		print('NO')
		continue
	print(s)
	for check in itertools.permutations(nums):
		s = 0
		for i in range(n):
			for k in range(i, n):
				s += nums[k] / (k + 1)
		if s == m:
			print('YES')
			break
		print(check, s)
	else:
		print('NO')


import sys, os, io
I = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for tc in range(1, 1 + int(I())):
	(n, m) = map(int, I().split())
	a = list(map(int, I().split()))
	print('YES' if sum(a) == m else 'NO')


t = int(input())
while t > 0:
	t -= 1
	(n, m) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	if sum(arr) == m:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, m) = map(int, input().split())
	l = sum(map(int, input().split()))
	print('YES') if l == m else print('NO')


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	N = [int(i) for i in input().strip().split()]
	if sum(N) == m:
		print('YES')
	else:
		print('NO')


import sys
import math

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

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

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(n, m) = get_ints()
	a = get_array()
	b = sum(a)
	if b == m:
		print('YES')
	else:
		print('NO')


import math

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

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))[:n]
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import math
test = int(input())
for t in range(test):
	tt = 0
	pp = 0
	cc = ''
	ss = ''
	dd = 1
	cnttt = 0
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	sum = 0
	for i in A:
		sum += i
	if sum == m:
		print('YES')
	else:
		print('NO')


t = int(input())
for hh in range(0, t):
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


from __future__ import print_function
from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()
for _ in range(t):
	(n, m) = gil()
	a = gil()
	print('YES' if sum(a) == m else 'NO')


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


for i in range(int(input())):
	(n, m) = map(int, input().split(' '))
	nums = list(map(int, input().split(' ')))
	nums.sort()
	sum1 = 0
	for j in range(len(nums)):
		sum1 = sum1 + nums[j] / (j + 1) * (j + 1)
	if int(sum1) == m:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout

def II():
	return int(stdin.readline())

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

def LI():
	return list(map(int, stdin.readline().split()))
yes = 'YES\n'
no = 'NO\n'

def solve():
	(n, m) = MI()
	a = LI()
	sa = sum(a)
	if sa == m:
		stdout.write(yes)
	else:
		stdout.write(no)
t = II()
for _ in range(t):
	solve()


test_count = int(input())
tests = []
for _ in range(test_count):
	tests.append((list(map(int, input().split())), list(map(int, input().split()))))
for test in tests:
	(n, m) = test[0]
	a = test[1]
	if m == sum(a):
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	a = sorted(a, reverse=True)
	sum1 = 0
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


import sys
sys.setrecursionlimit(311111)
ikimasu = sys.stdin.buffer.readline
ini = lambda : int(ins())
ina = lambda : list(map(int, ikimasu().split()))
ins = lambda : ikimasu().strip()
t = ini()
for _ in range(t):
	(n, m) = ina()
	tmp = ina()
	if sum(tmp) == m:
		print('Yes')
	else:
		print('No')


t = int(input())
for x in range(t):
	s = input()
	s1 = s.split()
	m = int(s1[1])
	s = input()
	s1 = s.split()
	l = [int(i) for i in s1]
	sum1 = sum(l)
	if sum1 == m:
		print('YES')
	else:
		print('NO')


test = int(input())
for _ in range(test):
	sum1 = 0
	(n, m) = input().split()
	n = int(n)
	m = int(m)
	tab = [int(i) for i in input().split()]
	for i in tab:
		sum1 += i
	if sum1 == m:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	print('YES' if sum(map(int, input().split())) == m else 'NO')


import sys
input = sys.stdin.readline

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

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

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

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

def isPrime(num):
	if num > 1:
		for i in range(2, num):
			if num % i == 0:
				return False
		return True
	else:
		return False

def calcSumPrime(n):
	s = 1
	for i in range(1, n + 1):
		if isPrime(i) == True:
			s = s * i
	return s

def main():
	t = inp()
	while t > 0:
		t -= 1
		(n, m) = invr()
		a = inlt()
		ans = 0
		for i in range(0, n):
			ans += a[i]
		if ans == m:
			print('YES')
		else:
			print('NO')
input = sys.stdin.readline
main()


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


import sys
from typing import List
sys.setrecursionlimit(10 ** 9)

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

def main():
	t = int(input())
	for _ in range(t):
		(n, m) = lmi()
		A = lmi()
		ans = solve(n, m, A)
		print(ans)

def solve(n, m, A):
	if sum(A) == m:
		return 'YES'
	else:
		return 'NO'
main()


import sys
input = sys.stdin.readline
for T in range(int(input())):
	(n, m) = map(int, input().split())
	print('YES' if sum(map(int, input().split())) == m else 'NO')


t = int(input())
for j in range(t):
	(n, m) = map(int, input().strip().split())
	l = list(map(int, input().strip().split()))
	if sum(l) == m:
		print('YES')
	else:
		print('NO')


try:
	for _ in range(int(input())):
		(n, m) = map(int, input().rstrip().split(' '))
		a = list(map(int, input().rstrip().split(' ')))
		if m == sum(a):
			print('YES')
		else:
			print('NO')
except:
	pass


import sys
import math
from collections import defaultdict, Counter
input = sys.stdin.readline

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	if sum(a) == m:
		print('YES')
	else:
		print('NO')


from sys import stdin
c = int(stdin.readline().strip())
for caso in range(c):
	(n, m) = map(int, stdin.readline().strip().split())
	s = list(map(int, stdin.readline().strip().split()))
	if sum(s) == m:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	s = 0
	sorted(a)
	s = sum(a)
	if s == m:
		print('YES')
	else:
		print('NO')


from functools import reduce
for i in range(int(input())):
	(n, m) = map(int, input().split())
	x = reduce(lambda x, y: x + y, list(map(int, input().split())))
	if x == m:
		print('YES')
	else:
		print('NO')


def reorder(values, m):
	if sum(values) == m:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	values = list(map(int, input().split()))
	print(reorder(values, m))


(i, k) = (input, int)
x = lambda : map(k, i().split())
for _ in ' ' * k(i()):
	(n, m) = x()
	print('YNEOS'[sum(x()) != m::2])