#include<bits/stdc++.h>
  using namespace std;
  #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL)
  #define pb push_back
  #define ll long long
  const ll MOD = 998244353;
  #define ln '\n'
  #define all(x) (x).begin(), (x).end()
  #define CLOCK cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  const ll INF=1e9;
 
 
      void solve(){
 
      }

      bool comp(const pair<pair<ll,ll>,ll>a,const pair<pair<ll,ll>,ll>b){
        if(a.first.first<b.first.first) return true;
        else if(a.first.first==b.first.first) return a.first.second<b.first.second;
        else if(a.first.second==b.first.second) return a.second<b.second;
        return false;
      }
 
   
 
       int main() {
        IOS;
         #ifndef ONLINE_JUDGE
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
         #endif
         
   
        ll tt=1;
        cin>>tt;
 
       while(tt--)
        {
                 
          ll n,x,sum=0,take=0;
          cin>>n>>x;
          vector<ll>v(n),v1;
          bool ok=true;

          for(ll i=0;i<n;i++){
            cin>>v[i];
            sum+=v[i];
          }
          if(sum==x){
            cout<<"NO"<<ln;
          }
          else{
            sum=0;
            ll i=0;
            cout<<"YES"<<ln;
            sort(all(v),greater<ll>());
            for(i=0;i<v.size();i++){
              sum+=v[i];
              if(v[i]==x){
                swap(v[i],v[i+1]);
               }
               cout<<v[i]<<' ';
               x-=v[i];

             }
             cout<<ln;   
          }
        }
        CLOCK; 
       return 0;
        
          }  