#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t, n, m, ans;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    int a[n];
    ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      ans += a[i];
    }
    if (ans == m)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
