// In The Name Of God

/*  ki oomade?!  */
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

typedef long long ll;
#define pb push_back
#define S second
#define F first
#define mkp make_pair
#define pll pair<ll, ll>
#define I insert
#define E erase
#define all(x) x.begin(), x.end()
 
using namespace std;
const ll N = 2e5 + 100;
const ll inf = 1e18, mod = 1e9 + 7;
 
 
ll q, n, a[N], m, cnt, ans, k, x, y;
vector <ll> v;
set <ll> st;
bool flag[N];

int main()
{
    ios_base::sync_with_stdio(false) , cin.tie(0), cout.tie(0);
    
    cin >> q;
    while(q --){
    	cin >> n >> x;
    	v.clear();
    	bool check = 0;
    	for(int i = 0; i < n; i ++) cin >> a[i], flag[i] = 0;
    	ll now = 0;
    	for(int i = 0; i < n; i ++) for(int j = 0; j < n; j ++) if(!flag[j] and x != now + a[j]) v.pb(a[j]), flag[j] = 1, now += a[j];
    	if(v.size() < n) {cout << "NO" << endl; continue;}
    	cout << "YES" << endl;
    	for(auto x : v) cout << x << ' ';
    		cout << endl;
    }
}
/*
 _____    _             
|  ___|__| | __ _ _ __  
| |_ / _ \ |/ _` | '_ \ 
|  _|  __/ | (_| | | | |
|_|  \___|_|\__,_|_| |_|
                        
 _  ___               _       _            __          
| |/ / |__   ___   __| | __ _| |__   __ _ / _| ___ ____
| ' /| '_ \ / _ \ / _` |/ _` | '_ \ / _` | |_ / _ \_  /
| . \| | | | (_) | (_| | (_| | | | | (_| |  _|  __// / 
|_|\_\_| |_|\___/ \__,_|\__,_|_| |_|\__,_|_|  \___/___|
                                                 		*/