#include <bits/stdc++.h>
int T, n, m, i, x, s;
inline void read(int &x) {
  short negative = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') negative = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  x *= negative;
}
signed main(void) {
  read(T);
  while (T--) {
    read(n), read(m);
    for (s = 0, i = 1; i <= n; i++) read(x), s += x;
    if (s == m)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
