#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, m;
  cin >> t;
  for (int k = 0; k < t; ++k) {
    int sum = 0;
    cin >> n >> m;
    int a[n];
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) sum += a[i];
    cout << (sum == m ? "YES\n" : "NO\n");
  }
}
