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