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