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