#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long c = 0, d = 0, e, f, m, n, p, x, y, z, i, j, k;
    string s;
    vector<long long> v;
    vector<long long> vc;
    cin >> n >> m;
    long long a[n], b[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
      c += a[i];
    }
    if (c == m)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
