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