#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, i, m, x, s = 0;
    cin >> n >> m;
    for (i = 1; i <= n; i++) {
      cin >> x;
      s += x;
    }
    if (s == m)
      cout << "YES";
    else
      cout << "NO";
    cout << '\n';
  }
  return 0;
}
