#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, test, n, m, value;
  cin >> test;
  while (test--) {
    int s = 0;
    cin >> n >> m;
    for (i = 1; i <= n; i++) {
      cin >> value;
      s += value;
    }
    if (s == m) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
