#include<bits/stdc++.h>
using namespace std;
#define M 105

int frq[M];

int main()
{
    int t;
    scanf("%d", &t);

    while(t--)
    {
        int n, x;
        scanf("%d %d", &n, &x);

        memset(frq, 0, sizeof(frq));
        for(int i = 1; i <= n; i++)
        {
            int p;
            scanf("%d", &p);

            frq[p]++;
        }

        vector<int> ans;

        
        for(int i = 1; i <= 100; i++)
        {
            while (frq[i] > 1)
            {
                ans.push_back(i);
                frq[i]--;
            }
        }

        for(int i = 1; i <= 100; i++)
        {
            if(frq[i])
            {
                ans.push_back(i);
                frq[i]--;
            }
        }

        int ald = 0;
        for(int i = 0; i < n; i++)
        {
            ald += ans[i];
            if(ald == x)
            {
                swap(ans[i], ans[n-1]);
                break;
            }
        }

        ald = 0;
        bool flag = true;
        for(int d: ans)
        {
            ald += d;
            if(ald == x)
            {
                flag = false;
                break;
            }
        }

        if(!flag) printf("NO\n");
        else
        {
            printf("YES\n");
            for(int d: ans) printf("%d ", d);
            printf("\n");
        }
    }

    return 0;
}