#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n, m, x;
  long long s = 0;
  cin >> T;
  for (int h = 0; h < T; h++) {
    cin >> n >> m;
    s = 0;
    for (int i = 0; i < n; i++) {
      cin >> x;
      s += x;
    }
    if (s == m)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
