#include <bits/stdc++.h>
using namespace std;
void test_case() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    cnt += a[i];
  }
  if (cnt == m)
    printf("YES\n");
  else
    printf("NO\n");
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    test_case();
  }
}
