#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
const long long inf = 1000000000000000000;
const long long KOK = 100000;
const long long LOG = 30;
const long long li = 500005;
const long long mod = 1000000007;
int n, m, b[li], a[li], k, flag, t;
int cev;
string s;
vector<int> v;
int main(void) {
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    cev = 0;
    for (int i = 1; i <= n; i++) cev += a[i];
    if (cev == m) {
      printf("YES\n");
    } else
      printf("NO\n");
  }
  return 0;
}
