#include <bits/stdc++.h>
signed main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, m;
    scanf("%d%d", &n, &m);
    std::vector<int> a(n);
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
    }
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      sum = sum + a[i];
    }
    if (sum != m) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
}
