#include <bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ll long long
#define pii pair<int, int>
#define sz(x) (int)x.size()
#define fr first
#define sc second
#define all(a) a.begin(), a.end()
#define int long long
 
const int N = 2e5 + 10;
const int INF = 1e9 + 10;
const int MOD = 1e9 + 7;

void solve() {
    int n, x;
    cin >> n >> x;
    vector<int> a(n);
    int s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }
    if(s == x) {
        cout << "NO\n";
        return;
    }
    sort(all(a));
    for(int i = 0; i < n; i++) {
        int idx = i;
        int cnt = 0;
        int pos = 1, sum = 0;
        while(cnt < n) {
            sum += a[idx];
            idx++;
            idx %= n;
            if(sum == x) {
                pos = 0;
                break;
            }
            cnt++;
        }
        if(pos) {
            idx = i;
            int cnt = 0;
            cout << "YES\n";
            while(cnt < n) {
                cout << a[idx] << ' ';
                idx++; idx %= n;
                cnt++;
            }
            cout << '\n';
            return;
        }
    }
    cout << "NO\n";
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    cin >> t;
    while(t--) {
        solve();
    }
}