#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 20, inf = 1e9;
int n, m, par[N], h[N], col[N], cntcol[N];
bool flag = true, isVal[N], mark[N];
vector<int> adj[N], ans;
void bfs(int root) {
  fill(par, par + n, -1);
  fill(h, h + n, inf);
  h[root] = 0;
  queue<int> q;
  q.push(root);
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (auto v : adj[u])
      if (h[v] == inf) {
        h[v] = h[u] + 1;
        par[v] = u;
        q.push(v);
      }
  }
  return;
}
void bfs2(int root) {
  h[root] = 0;
  queue<int> q;
  q.push(root);
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (auto v : adj[u])
      if (adj[v].size() % 3 == 2 && h[v] == inf) {
        h[v] = h[u] + 1;
        par[v] = u;
        q.push(v);
      }
  }
  return;
}
void dfs(int u, int c) {
  col[u] = c;
  for (auto v : adj[u])
    if (!col[v]) {
      if (adj[v].size() % 3 == 2) dfs(v, c);
    }
}
bool have_0_vertex(bool z) {
  if (n == 1) {
    flag = false;
    return false;
  }
  int u = -1;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 0) u = i;
  if (u != -1) {
    ans.push_back(u);
    return true;
  }
  return false;
}
bool have_121_path(bool z) {
  if (!flag) return false;
  int cnt = 0, u = -1;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 1) {
      u = i;
      cnt++;
    }
  if (cnt < 2) return false;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 0 && h[i] == inf) bfs(i);
  int v = -1, dis = n;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 1 && h[i])
      if (h[i] < dis) {
        dis = h[i];
        v = i;
      }
  if (dis == n) return false;
  if (dis == n - 1) {
    flag = false;
    return false;
  }
  while (v ^ -1) {
    ans.push_back(v);
    v = par[v];
  }
  if (z) cout << "have_122_path\n";
  return true;
}
bool have_2_cycle(bool z) {
  if (!flag) return false;
  bool ff = true;
  for (int i = 0; i < n; i++)
    if (adj[i].size() != 2) ff = false;
  if (ff) {
    vector<int> ver;
    int root = 0;
    while (true) {
      bool bb = false;
      mark[root] = true;
      ver.push_back(root);
      for (auto v : adj[root])
        if (!mark[v]) {
          bb = true;
          root = v;
        }
      if (!bb) break;
    }
    if (ver.size() == n) {
      flag = false;
      return false;
    }
  }
  vector<int> ver;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 2) ver.push_back(i);
  fill(par, par + n, -1);
  fill(h, h + n, inf);
  for (auto i : ver)
    if (h[i] == inf) bfs2(i);
  for (auto u : ver)
    for (auto v : adj[u])
      if (adj[v].size() % 3 == 2 && par[v] != u && par[u] != v) {
        vector<int> vec1, vec2;
        int x = u;
        while (x ^ -1) {
          vec1.push_back(x);
          x = par[x];
        }
        x = v;
        while (x ^ -1) {
          vec2.push_back(x);
          x = par[x];
        }
        reverse(vec1.begin(), vec1.end());
        reverse(vec2.begin(), vec2.end());
        int ind = 0;
        for (int i = 0; i < min(vec1.size(), vec2.size()); i++)
          if (vec1[i] == vec2[i]) ind = i;
        ans.clear();
        for (int i = ind; i < vec1.size(); i++) ans.push_back(vec1[i]);
        for (int i = ind + 1; i < vec2.size(); i++) ans.push_back(vec2[i]);
        if (z) cout << "have_2_cycle\n";
        return true;
      }
  return false;
}
bool have_122_components(bool z) {
  if (!flag) return false;
  int root = -1;
  for (int i = 0; i < n; i++)
    if (adj[i].size() % 3 == 1) root = i;
  int c = 1;
  for (int i = 0; i < n; i++)
    if (!col[i] && adj[i].size() % 3 == 2) {
      cntcol[c] = 0;
      dfs(i, c);
      c++;
    }
  for (auto v : adj[root]) cntcol[col[v]]++;
  for (int i = 1; i < c; i++)
    if (cntcol[i] % 3 == 0) {
      for (int j = 0; j < n; j++)
        if (col[j] != i) ans.push_back(j);
      if (z) cout << "1have_122_compopnents\n";
      return true;
    }
  int x = -1, y = -1;
  fill(par, par + n, -1);
  fill(h, h + n, inf);
  for (auto v : adj[root])
    if (col[v] == 1) {
      bfs2(v);
      x = v;
      break;
    }
  for (auto v : adj[root])
    if (col[v] == 2) {
      bfs2(v);
      y = v;
      break;
    }
  for (auto v : adj[root])
    if (col[v] == 1 && v != x) {
      int tmp = v;
      while (tmp != -1) {
        ans.push_back(tmp);
        tmp = par[tmp];
      }
      break;
    }
  for (auto v : adj[root])
    if (col[v] == 2 && v != y) {
      int tmp = v;
      while (tmp != -1) {
        ans.push_back(tmp);
        tmp = par[tmp];
      }
      break;
    }
  ans.push_back(root);
  if (ans.size() == n) return false;
  if (z) cout << "2have_122_compopnents\n";
  return true;
}
void prequery() {
  flag = true;
  ans.clear();
  for (int i = 0; i < n; i++) {
    adj[i].clear();
    col[i] = 0;
    isVal[i] = true;
    cntcol[i] = 0;
    mark[i] = false;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  int cnt = 0;
  while (t--) {
    cnt++;
    cin >> n >> m;
    prequery();
    int u, v;
    for (int i = 0; i < m; i++) {
      cin >> u >> v;
      adj[--u].push_back(--v);
      adj[v].push_back(u);
    }
    if (have_0_vertex(false) || have_121_path(false) || have_2_cycle(false) ||
        have_122_components(false)) {
      for (int i = 0; i < ans.size(); i++) isVal[ans[i]] = false;
      ans.clear();
      for (int i = 0; i < n; i++)
        if (isVal[i]) ans.push_back(i);
      cout << "YES\n" << ans.size() << "\n";
      for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << " ";
      cout << "\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
