// Problem: A. Phoenix and Gold
// Contest: Codeforces - Codeforces Global Round 14
// URL: https://codeforces.com/contest/1515/problem/A
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

/* Author : Atahar Islam Shihab
   ICT'16th Batch,MBSTU
*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define ll long long
#define maxele(v) *max_element(v.begin(),v.end())
#define minele(v) *min_element(v.begin(),v.end())
#define deb(x) cout << #x << " -> " << x << endl
#define deb2(x, y) cout << #x << " -> " << x << " || " << #y << " -> " << y << endl
#define fast  (ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0))
#define all(v) v.begin(),v.end()
#define sz(x) x.size()
#define clr(x) memset(x, 0, sizeof(x))
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
const int mxn = 100005;
 
int main()
{
  fast;
  int tc ;
  cin >> tc;
  while(tc--)
  {
  	int n,k;
  	cin >> n >> k;
  	vector<int>v(n),ans;
  	map<int,int>mp;
  	int l=0;
  	int s=0;
  	for(int i=0;i<n;++i){
  		cin >> v[i];
  		mp[v[i]]++;
  		s+=v[i];
  	}
  	if (s==k){
  		cout <<"NO\n";
  		continue;
  	}
  	cout <<"YES\n";
  	sort(all(v));
  	
  	int cur=0;
  	for(int i=0;i<n;++i){
  		l+=v[i];
  		if (l==k){
  			ans.pb(v[n-1]);
  			--n;	
  			l=INT_MIN;
  		}
  		ans.pb(v[i]);
  	} 
	
  	for(auto x : ans ) cout <<x<<" ";
  	cout <<"\n";
  	
  	
  }
 
 
  
 
  return 0;
}
