#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long testcases;
  cin >> testcases;
  while (testcases--) {
    long long n, m;
    cin >> n >> m;
    long long sum = 0;
    for (long long i = 0; i < n; i++) {
      long long x;
      cin >> x;
      sum += x;
    }
    if (sum == m) {
      cout << "YES";
    } else {
      cout << "NO";
    }
    cout << endl;
  }
  return 0;
}
