#include<bits/stdc++.h>
using namespace std;
const int manx=110;
int a[manx];
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		memset(a,0,sizeof(a));
		int n,x;
		cin>>n>>x;
		int sum=0;
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		if(sum==x)
		{
			cout<<"NO"<<endl;
			
		}
		else
		{
			cout<<"YES"<<endl;
			sort(a,a+n);
			sum=0;
			for(int i=0;i<n;i++)
			{
				if(sum+a[i]==x)
				{
					cout<<a[i+1]<<" "<<a[i]<<" ";
					sum=sum+a[i]+a[i+1];
					i=i+1;
					continue;
				}
				else
				{
					cout<<a[i]<<" ";
				sum+=a[i];
				
				}
				
			}
		}
		cout<<endl;
	}
	
	
	return 0;
 } 