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