#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
//#define int long long
#define pb push_back
#define pii pair<int,int>
#define x first
#define y second
#define sz(x) (int)x.size()
using namespace std;

const int N = 5e5 + 5;
vector<vector<int>> g;
int us[N], h[N], p[N], deg[N];
int  chk = 0;

void dfs(int v, int pp, int hh, int lim, vector<int>& cycle) {
    us[v] = 1;
    h[v] = hh;
    if (chk)
        return;
    p[v] = pp;
    for (int u : g[v]) {
        if (chk)
            return;
        if (u == pp)
            continue;
        if (deg[u] % 3 != 2)
            continue;
        if (us[u] == 1 && h[v] - h[u] != lim) {
            chk = 1;
            while(v != u) {
                cycle.pb(v);
                v = p[v];
            }
            cycle.pb(u);
            return;
        }
        if (us[u] == 0)
            dfs(u, v, hh + 1, lim, cycle);
    }
    us[v] = 2;
}

void dfs2(int v, int p, vector<int>& cur) {
    cur.pb(v);
    us[v] = 1;
    for (int u : g[v]) {
        if (us[u] || deg[u] % 3 != 2)
            continue;
        dfs2(u, v, cur);
    }
}

void solve() {
    int n, m;
    cin >> n >> m;
    g.resize(n);
    int cnt = 0;
    for (int i = 0; i < n; ++i)
        deg[i] = 0;
    for (int i = 0; i < m; ++i) {
        int fr, to;
        cin >> fr >> to;
        --fr;
        --to;
        g[fr].pb(to);
        g[to].pb(fr);
        ++deg[fr];
        ++deg[to];
    }
    for (int i = 0; i< n; ++i) {
        if (deg[i] % 3 == 0 && n != 1) {
            cout << "Yes\n" << n - 1 << "\n";
            for (int j = 0; j < n; ++j)
                if (j != i)
                    cout << j + 1 << " ";
            cout << "\n";
            return;
        }
        if (deg[i] % 3 == 1)
            ++cnt;
    }
    int st = -1;
    for (int i = 0; i < n; ++i) {
        if (deg[i] % 3 == 1) {
            st = i;
            break;
        }
    }
    if (st > -1) {
        vector<int> dist(n, 1e9);
        vector <int> used(n);
        dist[st] = 0;
        queue<int> q;
        vector<int> p(n, -1);
        q.push(st);
        while (sz(q)) {
            int v = q.front();
            q.pop();
            if (used[v])
                continue;
            used[v] = 1;
            for (int u : g[v])
                if (dist[u] > dist[v] + 1) {
                    dist[u] = dist[v] + 1;
                    p[u] = v;
                    q.push(u);
                }
        }
        for (int i = 0; i < n; ++i) {
            if (deg[i] % 3 == 1 && i != st && dist[i] != n - 1) {
                cout << "Yes\n";
                vector<int> ans(n);
                int u = i;
                int tmp = 0;
                while (u != -1) {
                    ans[u] = 1;
                    ++tmp;
                    u = p[u];
                }
                cout << n - tmp << "\n";
                for (int j = 0; j < n; ++j)
                    if (!ans[j])
                        cout << j + 1 << " ";
                cout << "\n";
                return;
            }
        }
    }
    int fl = 0;
    for (int i = 0; i < n; ++i)
        if (deg[i] % 3 == 2 && deg[i] > 2)
            fl = 1;
    if (fl) {
        for (int i = 0; i < n; ++i) {
            us[i] = 0;
            h[i] = 0;
            p[i] = 0;
        }
        for (int i = 0; i < n; ++i)
            if (!us[i] && deg[i] % 3 == 2) {
                chk = 0;
                vector<int>cycle;
                dfs(i, -1, 0, n, cycle);
                if (chk) {
                    vector<int> ans(n);
                    int tmp = 0;
                    for (int j : cycle) {
                        ans[j] = 1;
                        tmp++;
                    }
                    cout << "Yes\n" << n - tmp << "\n";
                    for (int j = 0; j < n; ++j)
                        if (!ans[j])
                            cout << j+1 << " ";
                    cout << "\n";
                    return;
                }
            }
    }
    if (cnt) {
        for (int i = 0; i < n; ++i) {
            us[i] = 0;
            h[i] = 0;
            p[i] = 0;
        }
        vector<int> lf, rf;
        for (int u : g[st]) {
            if (!us[u])
                if (lf.size() == 0)
                    dfs2(u, st, lf);
                else if (rf.size() == 0)
                    dfs2(u, st, rf);
                else {
                    cout << "Yes\n" << n - sz(lf) - sz(rf) - 1 << "\n";
                    vector<int> ans(n);
                    for (int j : lf)
                        ans[j] = 1;
                    for (int j : rf)
                        ans[j] = 1;
                    for (int j = 0; j < n; ++j)
                        if (!ans[j])
                            cout << j + 1 << " ";
                    cout << "\n";
                    return;
                }
        }
        if (lf.empty() || rf.empty()) {
            cout << "No\n";
            return;
        }
        fl = 0;
        for (int i : lf)
            if (deg[i] != 2)
                fl |= 1;
        for (int i : rf) {
            if (deg[i] != 2)
                fl |= 2;
        }
        if (!fl) {
            cout << "No\n";
            return;
        }
        vector <int> used(n);
        vector <int> par(n);
        vector <int> alf(n), arf(n);
        for (int i : lf)
            alf[i] = 1;
        for (int i : rf)
            arf[i] = 1;
        if (fl & 1) {
            par[st] = -1;
            queue<int> q;
            q.push(st);
            vector<int> res;
            while (sz(q)) {
                int v = q.front();
                used[v] = 1;
                q.pop();
                for (int u : g[v]) {
                    if (alf[u] == 0)
                        continue;
                    if (used[u] && res.size() == 0) {
                        int cur = u;
                        while (cur != st) {
                            res.pb(cur);
                            cur = p[cur];
                        }
                        cur = v;
                        while (cur != st) {
                            res.pb(cur);
                            cur = p[cur];
                        }
                    }
                    if (!used[u]) {
                        used[u] = 1;
                        q.push(u);
                    }
                }
            }
            vector <int> ans(n);
            ans[st] = 1;
            for (int i : res)
                ans[i] = 1;
            for (int i : rf)
                ans[i] = 1;
            cout << "Yes\n" << n - sz(res) - 1 - sz(rf) << "\n";
            for (int i = 0; i < n; ++i)
                if (!ans[i]) {
                    cout << i + 1 << " ";
                }
            cout << "\n";
            return;
        }
        par[st] = -1;
        queue<int> q;
        q.push(st);
        vector<int> res;
        while (sz(q)) {
            int v = q.front();
            used[v] = 1;
            q.pop();
            for (int u : g[v]) {
                if (arf[u] == 0)
                    continue;
                if (used[u] && res.size() == 0) {
                    int cur = u;
                    while (cur != st) {
                        res.pb(cur);
                        cur = p[cur];
                    }
                    cur = v;
                    while (cur != v) {
                        res.pb(cur);
                        cur = p[cur];
                    }
                }
                if (!used[u]) {
                    used[u] = 1;
                    q.push(u);
                }
            }
        }
        vector <int> ans(n);
        ans[st] = 1;
        for (int i : res)
            ans[i] = 1;
        for (int i : lf)
            ans[i] = 1;
        cout << "Yes\n" << n - sz(res) - 1 - sz(lf) << "\n";
        for (int i = 0; i < n; ++i)
            if (!ans[i]) {
                cout << i + 1 << " ";
            }
        cout << "\n";
        return;
    }
    cout << "No\n";
    return;
}

signed main() {
    int t;
    cin >> t;
    while (t--) {
        g.resize(0);
        solve();
    }
    return 0;
}
