#include<bits/stdc++.h>
// getline(cin,string)
// cin.ignore()
#define ll long long int
#define vll vector<long long int>
#define sll set<long long int>
#define lll list<long long int>
#define mll map<long long int, long long int>
#define fr(i,a,b) for(i=a;i<b;i++)
#define Fr(i,a) for(i=0;i<a;i++)
#define nope {cout<<"NO\n"; return;}
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define pb push_back
#define endl "\n"
#define llmin LLONG_MIN
#define llmax LLONG_MAX
#define imax INT_MAX

using namespace std;

void solve(){
    ll n,i,mx,sum=0,ele;
    cin>>n>>mx;
    lll w;
    fr(i,0,n) {cin>>ele; w.pb(ele); sum+=ele;}
    w.sort();
    // if(w.front()==w.back() && mx%w.front()==0) nope
    if(sum==mx) nope
    else cout<<"YES\n";

    // if(mx>sum) {
    //     for(auto j:w) cout<<j<<" ";
    //     cout<<endl;
    //     return;
    // }



    sum=0;
    ll xt=0;
    for(auto i:w)
    {
        sum+=i;
        if(sum==mx){
            xt=i;
            continue;
        }
        cout<<i<<" ";
    }
    if(xt) cout<<xt;
    cout<<endl;
    return;

}

int main()
{
    fastio;
    int t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}