#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 8;
const int mod = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    float ans = 0;
    for (int i = 0; i < n; i++) {
      float temp;
      cin >> temp;
      ans += temp;
    }
    if (ans == m)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}
