#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 100 * 1000 + 17;
int t, n, m, col[MAXN], par_cyc[MAXN], par_bfs[MAXN], cnt_cmp;
bool isAns[MAXN], hasFindedAns, mark_cmp[MAXN], have_edge[MAXN],
    mark_bfs_cmp[MAXN];
vector<int> adj[MAXN], cmp[MAXN], trash;
void output(bool flag, vector<int> &ans = trash) {
  if (flag && ans.size() < n && ans.size() > 0) {
    cout << "Yes" << endl;
    for (auto i : ans) isAns[i] = true;
    cout << n - ans.size() << endl;
    for (int i = 1; i <= n; i++)
      if (!isAns[i]) cout << i << " ";
    cout << endl;
  } else
    cout << "No" << endl;
}
void dfs_cyc(int v) {
  if (hasFindedAns) return;
  col[v] = 1;
  for (auto i : adj[v]) {
    if (hasFindedAns) return;
    if (col[i] == 1 && i != par_cyc[v]) {
      vector<int> ans;
      int tmp = v;
      hasFindedAns = true;
      while (tmp != i) {
        ans.push_back(tmp);
        tmp = par_cyc[tmp];
      }
      ans.push_back(tmp);
      output(true, ans);
      return;
    } else if (!col[i] && adj[i].size() % 3 == 2)
      par_cyc[i] = v, dfs_cyc(i);
  }
  col[v] = 2;
}
void bfs_path(int v) {
  queue<int> q;
  q.push(v);
  while (!q.empty()) {
    if (hasFindedAns) return;
    int u = q.front();
    q.pop();
    for (auto i : adj[u])
      if (!par_bfs[i] && i != v && !hasFindedAns) {
        par_bfs[i] = u;
        q.push(i);
        if (adj[i].size() % 3 == 1) {
          hasFindedAns = true;
          int tmp = i;
          vector<int> ans;
          while (tmp != v) {
            ans.push_back(tmp);
            tmp = par_bfs[tmp];
          }
          ans.push_back(tmp);
          output(true, ans);
        }
      }
  }
}
void dfs_cmp(int v) {
  cmp[cnt_cmp].push_back(v);
  mark_cmp[v] = true;
  for (auto i : adj[v])
    if (!mark_cmp[i] && adj[i].size() % 3 != 1) dfs_cmp(i);
}
pair<int, int> bfs_cmp(int x) {
  int v;
  for (auto i : cmp[x])
    if (have_edge[i]) v = i;
  queue<int> q;
  q.push(v);
  mark_bfs_cmp[v] = true;
  bool fl = false;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto i : adj[u])
      if (!mark_bfs_cmp[i] && adj[i].size() % 3 != 1) {
        mark_bfs_cmp[i] = true;
        q.push(i);
        if (have_edge[i]) return make_pair(v, i);
      }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n >> m;
    cnt_cmp = 0;
    for (int i = 1; i <= n; i++)
      adj[i].clear(), cmp[i].clear(),
          isAns[i] = false, col[i] = 0, par_cyc[i] = 0, par_bfs[i] = 0,
          have_edge[i] = 0, mark_cmp[i] = 0, mark_bfs_cmp[i] = 0;
    for (int i = 1; i <= m; i++) {
      int v, u;
      cin >> v >> u;
      adj[v].push_back(u);
      adj[u].push_back(v);
    }
    if (n <= 3) {
      output(false);
      continue;
    }
    hasFindedAns = false;
    for (int i = 1; i <= n; i++)
      if (adj[i].size() % 3 == 0) {
        vector<int> ans;
        ans.push_back(i);
        output(true, ans);
        hasFindedAns = true;
        break;
      }
    if (hasFindedAns) continue;
    int k2 = 0;
    for (int i = 1; i <= n; i++)
      if (adj[i].size() % 3 == 2) {
        k2 = i;
        break;
      }
    if (k2) dfs_cyc(k2);
    if (hasFindedAns) continue;
    int k1_1 = 0, cnt3k1 = 0;
    for (int i = 1; i <= n; i++)
      if (adj[i].size() % 3 == 1) {
        k1_1 = i;
        cnt3k1++;
      }
    if (k1_1 && cnt3k1 > 1) bfs_path(k1_1);
    if (hasFindedAns) continue;
    for (int i = 1; i <= n; i++)
      if (adj[i].size() % 3 != 1 && !mark_cmp[i]) cnt_cmp++, dfs_cmp(i);
    if (cnt_cmp == 1) {
      output(false);
      continue;
    }
    for (auto i : adj[k1_1]) have_edge[i] = true;
    pair<int, int> inFi = bfs_cmp(1), inSe = bfs_cmp(2);
    vector<int> ans;
    ans.push_back(inFi.first);
    ans.push_back(inFi.second);
    ans.push_back(inSe.first);
    ans.push_back(inSe.second);
    ans.push_back(k1_1);
    output(true, ans);
  }
  return 0;
}
