#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    long long int s = 0, a[n];
    for (long long int i = 0; i < n; ++i) {
      cin >> a[i];
      s += a[i];
    }
    if (s == m) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  return 0;
}
