#include <bits/stdc++.h>
int main() {
  int t;
  int n, m;
  int ans;
  int v;
  scanf("%d", &t);
  while (t--) {
    ans = 0;
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i) {
      scanf("%d", &v);
      ans += v;
    }
    if (ans == m)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
