#include <bits/stdc++.h>
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230;
#pragma warning(disable : 4996)
using namespace std;
template <class T1, class T2>
long long gcd(T1 a, T2 b) {
  if (a == b) {
    return a;
  } else if (a == 1 || b == 1) {
    return 1;
  }
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class T1, class T2>
bool IN(T1 a, T2 b) {
  for (auto r : b) {
    if (r == a) {
      return true;
    }
  }
  return false;
}
const long long inf = (long long)1000000000000000111;
const int iinf = (int)1000000111;
const int SIZE = 100011;
long long t, i, k, n, m, sum;
long long v[200];
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> m;
    sum = 0;
    for (i = 1; i <= n; i++) {
      cin >> v[i];
      sum += v[i];
    }
    if (sum == m) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
}
