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