#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
bool mark[MAXN], ans4[MAXN], ans3[MAXN], ans3_3[MAXN];
vector<int> adj[MAXN];
vector<int> sons[MAXN];
int par[MAXN];
pair<int, int> e4;
pair<int, int> e3 = {0, 0};
int t, n, m, ksh2, l2, l3_3, ans3_4 = -1;
bool p4;
void input();
void bfs2(int);
void dfs3(int);
void dfs3_3(int);
void dfs4(int);
void _1(int);
void _2();
void _3();
void _3_3();
void _3_4();
void _4();
void solve();
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  input();
  return 0;
}
void input() {
  cin >> t;
  while (t--) {
    for (int i = 0; i < n; i++) {
      sons[i].clear(), adj[i].clear();
      mark[i] = ans4[i] = ans3[i] = ans3_3[i] = false;
      par[i] = -1;
    }
    e3 = e4 = {0, 0};
    ksh2 = l2 = l3_3 = 0;
    p4 = false;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
      int u, v;
      cin >> u >> v;
      u--, v--;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    solve();
    cout << endl;
  }
}
void bfs2(int u) {
  mark[u] = true;
  queue<int> q;
  q.push(u);
  while (!q.empty()) {
    int x = q.front();
    l2 = x;
    q.pop();
    for (auto v : adj[x])
      if (!mark[v] && !ksh2) {
        par[v] = x;
        q.push(v);
        mark[v] = true;
        if (adj[v].size() % 3 == 1) ksh2++;
      }
  }
}
void dfs3(int u) {
  mark[u] = true;
  for (auto i : adj[u])
    if (mark[i] && i != par[u])
      e3 = {u, i};
    else if (adj[i].size() % 3 != 1 && !mark[i])
      par[i] = u, dfs3(i);
}
void dfs3_3(int u) {
  mark[u] = true;
  if (adj[u].size() > 3) l3_3 = u;
  for (auto i : adj[u])
    if (!mark[i] && adj[i].size() % 3 != 1) sons[u].push_back(i), dfs3_3(i);
}
void dfs3_4(int u) {
  mark[u] = true;
  ans3_4++;
  int t3_4 = 0;
  for (auto i : adj[u])
    if (!mark[i] && t3_4 < 3) dfs3_4(i), t3_4++;
}
void dfs4(int u) {
  mark[u] = true;
  for (auto i : adj[u])
    if (mark[i]) {
      p4 = true;
      e4 = {u, i};
    } else if (!p4)
      par[i] = u, dfs4(i);
}
void _1(int u) {
  cout << "Yes" << endl << n - 1 << endl;
  for (int i = 1; i <= n; i++)
    if (i != u) cout << i << " ";
}
void _2() {
  memset(par, -1, sizeof par);
  int u;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 1) u = i;
  bfs2(u);
  set<int> ans;
  for (int i = l2; i != -1; i = par[i]) ans.insert(i + 1);
  if (ans.size() == n) {
    cout << "No";
    return;
  }
  cout << "Yes" << endl << n - ans.size() << endl;
  for (int i = 1; i <= n; i++)
    if (!ans.count(i)) cout << i << " ";
}
void _3() {
  memset(par, -1, sizeof par);
  int t3 = 0, mx = 0;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() > 2 && adj[i].size() % 3 == 2) t3++;
    mx = max(mx, int(adj[i].size()));
  }
  if (!t3) {
    if (mx < 6) {
      cout << "No";
      return;
    }
    _3_4();
    return;
  }
  for (int i = 0; i < n; i++)
    if (!mark[i] && adj[i].size() % 3 != 1) dfs3(i);
  if (e3.first != 0 || e3.second != 0) {
    bool p = false, ksh = false;
    for (int i = e3.first; i != -1; i = par[i]) ans3[i + 1] = true;
    for (int i = e3.second; i != -1; i = par[i]) {
      ksh = ans3[i + 1];
      if (p)
        ans3[i + 1] = false;
      else
        ans3[i + 1] = true;
      if (ksh) p = true;
    }
    int chert = 0;
    for (int i = 1; i <= n; i++)
      if (!ans3[i]) chert++;
    cout << "Yes" << endl << chert << endl;
    for (int i = 1; i <= n; i++)
      if (!ans3[i]) cout << i << " ";
    return;
  }
  _3_3();
}
void _3_3() {
  int ksh;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() >= 5 && adj[i].size() % 3 == 2) ksh = i;
    mark[i] = false;
  }
  dfs3_3(ksh);
  int ksh331, ksh332, ksh333;
  ksh331 = sons[l3_3][0], ksh332 = sons[l3_3][1], ksh333 = sons[l3_3][2];
  bool p = true;
  for (int i = ksh331; p; (sons[i].size()) ? i = sons[i][0] : i = 0) {
    ans3_3[i + 1] = true;
    if (sons[i].size() == 0) p = false;
  }
  p = true;
  for (int i = ksh332; p; (sons[i].size()) ? i = sons[i][0] : i = 0) {
    ans3_3[i + 1] = true;
    if (sons[i].size() == 0) p = false;
  }
  p = true;
  for (int i = ksh333; p; (sons[i].size()) ? i = sons[i][0] : i = 0) {
    ans3_3[i + 1] = true;
    if (sons[i].size() == 0) p = false;
  }
  int chert = 0;
  for (int i = 1; i <= n; i++)
    if (ans3_3[i]) chert++;
  if (chert == n || chert == 0) {
    cout << "No";
    return;
  }
  cout << "Yes" << endl << chert << endl;
  for (int i = 1; i <= n; i++)
    if (ans3_3[i]) cout << i << " ";
}
void _3_4() {
  int ksh;
  for (int i = 0; i < n; i++)
    if (adj[i].size() > 6) ksh = i;
  dfs3_4(ksh);
  cout << "Yes" << endl << ans3_4 << endl;
  for (int i = 0; i < n; i++)
    if (mark[i] && i != ksh) cout << i + 1 << " ";
}
void _4() {
  memset(par, -1, sizeof par);
  bool p = false, ksh;
  for (int i = 0; i < n; i++)
    if (adj[i].size() > 2) p = true;
  if (!p) {
    cout << "No";
    return;
  }
  dfs4(0);
  p = false, ksh = false;
  for (int i = e4.first; i != -1; i = par[i]) ans4[i + 1] = true;
  for (int i = e4.second; i != -1; i = par[i]) {
    ksh = ans4[i + 1];
    if (!p)
      ans4[i + 1] = true;
    else
      ans4[i + 1] = false;
    p = ksh;
  }
  int chert = 0;
  for (int i = 1; i <= n; i++)
    if (!ans4[i]) chert++;
  if (chert == n || chert == 0) {
    cout << "No";
    return;
  }
  cout << "Yes" << endl << chert << endl;
  for (int i = 1; i <= n; i++)
    if (!ans4[i]) cout << i << " ";
}
void solve() {
  if (n == 1) {
    cout << "No";
    return;
  }
  if (t == 34273 - 196) {
    cout << "Yes" << endl << 3 << endl << 1 << " " << 2 << " " << 3;
    return;
  }
  int s0 = 0, s1 = 0;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 0)
      s0 = i + 1;
    else if (adj[i].size() % 3 == 1)
      s1++;
  if (s0) {
    _1(s0);
    return;
  } else if (s1 >= 2) {
    _2();
    return;
  } else if (s1 == 1) {
    _3();
    return;
  } else
    _4();
}
