#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("avx2")
const int mod = 998244353;
const int mxN = 3e5 + 5;
int32_t main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m, s = 0;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      s += a;
    }
    if (s == m)
      cout << "YES";
    else
      cout << "NO";
    cout << "\n";
  }
  return 0;
}
