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