/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N_MAX = 100;

int t;

int n, x;

int a[N_MAX + 2];

multiset <pair <int, int>> s;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> t;
    while(t--)
    {
        cin >> n >> x;
        for(int i = 1; i <= n; i++)
            cin >> a[i];
        for(int i = 1; i <= n; i++)
            s.insert(make_pair(a[i], i));
        vector <int> sol;
        int sum = 0;
        while(s.empty() == false)
        {
            int now = s.begin()->second;
            if(sum + a[now] == x)
            {
                multiset <pair <int, int>> :: iterator it = s.upper_bound(make_pair(a[now], INT_MAX));
                if(it == s.end())
                    break;
                now = it->second;
            }
            sum += a[now];
            sol.push_back(now);
            s.erase(s.find(make_pair(a[now], now)));
        }
        if(s.empty() == true)
        {
            cout << "YES\n";
            for(int i : sol)
                cout << a[i] << " ";
            cout << "\n";
        }
        else
            cout << "NO\n";
        sol.clear();
        s.clear();
    }
    return 0;
}
