#include <bits/stdc++.h>
using namespace std;
const long long int N = 5e5 + 5;
void solve() {
  long long int n;
  cin >> n;
  long long int m;
  cin >> m;
  vector<long long int> v(n);
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  if (sum == m) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
