#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long int mod = 1e9 + 7;
const long long int pinf = ((long long int)2e18);
const long long int ninf = ((long long int)-2e18);
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int te;
  cin >> te;
  while (te--) {
    long long int sum = 0, m, n, k, y, i, l, j;
    cin >> n >> m;
    vector<long long int> a(n);
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    if (sum == m) {
      cout << "YES" << '\n';
    } else {
      cout << "NO" << '\n';
    }
  }
  return 0;
}
