#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, m, tmp;
  cin >> t;
  int a;
  while (t--) {
    a = 0;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
      cin >> tmp;
      a += tmp;
    }
    if (a == m) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
