#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, m;
vector<int> v[N];
void print(vector<int> vv) {
  static bool vis[N];
  memset(vis + 1, 0, sizeof(bool) * n);
  for (auto &i : vv) vis[i] = 1;
  for (auto &i : vv) {
    int d = 0;
    for (auto &j : v[i]) d += vis[j];
    assert(d % 3 == int(v[i].size()) % 3);
  }
  cout << "Yes\n" << n - vv.size() << endl;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cout << i << ' ';
  cout << endl;
}
vector<int> get_path(vector<int> vv) {
  static int pre[N], dis[N];
  int xx = vv[0], yy = vv[1];
  queue<int> q;
  pre[vv[0]] = -1;
  dis[vv[0]] = 0;
  q.push(vv[0]);
  vector<int> tmp;
  while (!q.empty()) {
    int nd = q.front();
    tmp.push_back(nd);
    q.pop();
    for (auto &i : v[nd])
      if (!pre[i]) dis[i] = dis[nd] + 1, pre[i] = nd, q.push(i);
  }
  for (int i = 2; i < int(vv.size()); i++)
    if (dis[vv[i]] < dis[yy]) yy = vv[i];
  vector<int> ret;
  ret.push_back(yy);
  while (yy != xx) ret.push_back(yy = pre[yy]);
  while (!tmp.empty()) pre[tmp.back()] = 0, tmp.pop_back();
  return ret;
}
int f[N];
int getf(int v) { return f[v] == v ? v : f[v] = getf(f[v]); }
int fa[N], dep[N], mn, tx, ty;
bool vis[N];
void dfs(int pos) {
  for (auto &i : v[pos])
    if (vis[i]) {
      if (!fa[i])
        fa[i] = pos, dep[i] = dep[pos] + 1, dfs(i);
      else if (dep[i] < dep[pos] && i != fa[pos] && dep[pos] - dep[i] < mn)
        mn = dep[pos] - dep[i], tx = pos, ty = i;
    }
}
bool chk(vector<int> vv) {
  mn = INT_MAX;
  memset(vis + 1, 0, sizeof(bool) * n);
  memset(fa + 1, 0, sizeof(int) * n);
  for (auto &i : vv) vis[i] = 1;
  for (auto &i : vv)
    if (!fa[i]) fa[i] = -1, dep[i] = 0, dfs(i);
  return mn < INT_MAX;
}
int main() {
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    cin >> n >> m;
    if (n == 1) {
      cout << "No" << endl;
      continue;
    }
    for (int i = 1; i <= n; i++) v[i].clear();
    int t1, t2;
    for (int i = 1; i <= m; i++)
      cin >> t1 >> t2, v[t1].push_back(t2), v[t2].push_back(t1);
    int tt;
    for (tt = 1; tt <= n; tt++)
      if (v[tt].size() % 3 == 0) break;
    if (tt <= n) {
      print({tt});
      continue;
    }
    vector<int> v1, v2;
    for (int i = 1; i <= n; i++)
      if (v[i].size() % 3 == 1)
        v1.push_back(i);
      else
        v2.push_back(i);
    if (v1.size() > 1) {
      v2 = get_path(v1);
      if (int(v2.size()) == n) {
        cout << "No" << endl;
        continue;
      }
      print(v2);
    } else if (chk(v2)) {
      vector<int> vv;
      vv.push_back(tx);
      while (tx != ty) vv.push_back(tx = fa[tx]);
      if (int(vv.size()) == n) {
        cout << "No" << endl;
        continue;
      }
      print(vv);
    } else {
      static vector<int> vv[N];
      static bool vis[N];
      for (int i = 1; i <= n; i++) f[i] = i;
      memset(vis + 1, 0, sizeof(bool) * n);
      for (int i = 1; i <= n; i++)
        if (i != v1[0]) {
          int j = 0;
          while (j < int(v[i].size()))
            if (v[i][j] == v1[0])
              break;
            else
              ++j;
          if (j < int(v[i].size())) v[i].erase(v[i].begin() + j), vis[i] = 1;
          for (auto &k : v[i])
            if (k != v1[0]) f[getf(k)] = getf(i);
        }
      for (int i = 1; i <= n; i++) vv[i].clear();
      for (int i = 1; i <= n; i++)
        if (i != v1[0] && vis[i]) vv[getf(i)].push_back(i);
      vector<int> v0{v1[0]};
      int s = 0;
      for (int i = 1; i <= n; i++)
        if (i != v1[0] && getf(i) == i) {
          assert(vv[i].size() > 1);
          vector<int> pp = get_path(vv[i]);
          if (s < 2) ++s, v0.insert(v0.end(), pp.begin(), pp.end());
        }
      if (int(v0.size()) == n) {
        cout << "No" << endl;
        continue;
      }
      print(v0);
    }
  }
  return 0;
}
