#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int mod = 998244353;
int a[N], b[N];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m, ans = 0;
    cin >> n >> m;
    for (int i = 1, x; i <= n; i++) {
      cin >> x;
      ans += x;
    }
    if (ans == m)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
