#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500010;
int t, n, m;
int color[MAXN], cycle[MAXN], level[MAXN];
int bfsvec[MAXN], count_cmp, bfsvec_cmp[MAXN];
bool found, mark_cmp[MAXN], have_edge[MAXN];
vector<int> edge[MAXN], cmp[MAXN];
void print(bool solvable, vector<int> ans = {}) {
  if (solvable && ans.size() < n && ans.size() > 0) {
    cout << "Yes" << endl;
    vector<bool> skipp(n + 1, false);
    for (int i : ans) skipp[i] = true;
    cout << n - ans.size() << endl;
    for (int i = 1; i <= n; i++)
      if (!skipp[i]) cout << i << " ";
    cout << endl;
  } else
    cout << "No" << endl;
}
bool less_id(const int& i, const int& j) { return level[i] > level[j]; }
void dfs_cyc(int v) {
  if (found) return;
  color[v] = 1;
  vector<int> p;
  for (int i : edge[v])
    if (color[i] == 1 && i != cycle[v] && edge[i].size() % 3 == 2)
      p.push_back(i);
  if (p.size()) {
    sort(p.begin(), p.end(), less_id);
    vector<int> ans;
    int tmp = v;
    found = true;
    while (tmp != p[0]) {
      ans.push_back(tmp);
      tmp = cycle[tmp];
    }
    ans.push_back(tmp);
    print(true, ans);
    return;
  }
  for (int i : edge[v])
    if (!color[i] && edge[i].size() % 3 == 2 && !p.size()) {
      cycle[i] = v;
      level[i] = level[v] + 1;
      dfs_cyc(i);
    }
  color[v] = 2;
}
void dfs_cmp(int v) {
  cmp[count_cmp].push_back(v);
  mark_cmp[v] = true;
  for (int i : edge[v])
    if (!mark_cmp[i] && edge[i].size() % 3 != 1) dfs_cmp(i);
}
void bfs_path(int v) {
  bfsvec[v] = v;
  queue<int> q;
  q.push(v);
  while (!q.empty()) {
    if (found) return;
    int u = q.front();
    q.pop();
    for (int i : edge[u]) {
      if (!bfsvec[i] && i != v) {
        bfsvec[i] = u;
        q.push(i);
        if (edge[i].size() % 3 == 1) {
          found = true;
          int tmp = i;
          vector<int> ans;
          while (tmp != v) {
            ans.push_back(tmp);
            tmp = bfsvec[tmp];
          }
          ans.push_back(tmp);
          print(true, ans);
          return;
        }
      }
    }
  }
}
vector<int> bfs_cmp(int x) {
  int v;
  for (int i : cmp[x])
    if (have_edge[i]) v = i;
  queue<int> q;
  q.push(v);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i : edge[u]) {
      if (!bfsvec_cmp[i] && edge[i].size() % 3 != 1 && i != v) {
        bfsvec_cmp[i] = u;
        q.push(i);
        if (have_edge[i]) {
          vector<int> res;
          int tmp = i;
          while (tmp != v) {
            res.push_back(tmp);
            tmp = bfsvec_cmp[tmp];
          }
          res.push_back(tmp);
          return res;
        }
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> n >> m;
    count_cmp = 0;
    for (int i = 1; i <= n; i++) {
      edge[i].clear();
      cmp[i].clear();
      color[i] = 0;
      cycle[i] = 0;
      bfsvec[i] = 0;
      have_edge[i] = 0;
      mark_cmp[i] = 0;
      bfsvec_cmp[i] = 0;
      level[i] = 0;
    }
    for (int i = 1; i <= m; i++) {
      int u, v;
      cin >> u >> v;
      edge[v].push_back(u);
      edge[u].push_back(v);
    }
    if (n <= 3) {
      print(false);
      continue;
    }
    found = false;
    for (int i = 1; i <= n; i++)
      if (edge[i].size() % 3 == 0) {
        vector<int> ans;
        ans.push_back(i);
        print(true, ans);
        found = true;
        break;
      }
    if (found) continue;
    for (int i = 1; i <= n; i++)
      if (edge[i].size() % 3 == 2 && cycle[i] == 0) {
        dfs_cyc(i);
      }
    if (found) continue;
    int k1_1 = 0, cnt3k1 = 0;
    for (int i = 1; i <= n; i++)
      if (edge[i].size() % 3 == 1) {
        k1_1 = i;
        cnt3k1++;
      }
    if (k1_1 && cnt3k1 > 1) bfs_path(k1_1);
    if (found) continue;
    for (int i = 1; i <= n; i++)
      if (edge[i].size() % 3 != 1 && !mark_cmp[i]) count_cmp++, dfs_cmp(i);
    if (count_cmp == 1) {
      print(false);
      continue;
    }
    for (int i : edge[k1_1]) have_edge[i] = true;
    vector<int> infirst = bfs_cmp(1), insecond = bfs_cmp(2);
    vector<int> ans;
    for (int i : infirst) ans.push_back(i);
    for (int i : insecond) ans.push_back(i);
    ans.push_back(k1_1);
    print(true, ans);
  }
  return 0;
}
