#include <bits/stdc++.h>
using namespace std;
const long long MAXN = (long long)((1e5) + 100);
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
void prl(long long x) { cout << x << "\n"; }
const long long N = (long long)(1 * 1e6 + 10);
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    long long a[n + 1];
    for (long long i = 1; i <= n; i++) cin >> a[i];
    long long ans = 0;
    for (long long i = 1; i <= n; i++) {
      ans += a[i];
    }
    (ans == m) ? cout << "YES\n" : cout << "NO\n";
  }
}
