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