#include <bits/stdc++.h>
using namespace std;
void dfsCycle(int node, vector<vector<int>> &g, vector<int> &depth,
              vector<int> &f, vector<int> &color, int &minn, int &lower,
              int &upper) {
  for (auto a : g[node]) {
    if (depth[a] >= 0) {
      if (depth[a] < depth[node] - 1 and depth[node] - depth[a] < minn) {
        minn = depth[node] - depth[a];
        lower = node;
        upper = a;
      }
      continue;
    }
    color[a] = color[node];
    depth[a] = depth[node] + 1;
    f[a] = node;
    dfsCycle(a, g, depth, f, color, minn, lower, upper);
  }
}
void dfs(int node, vector<vector<int>> &g, vector<int> &f, vector<int> &hit,
         int &who) {
  if (hit[node] and who < 0) {
    who = node;
  }
  for (auto a : g[node]) {
    if (f[a] >= 0) continue;
    f[a] = node;
    dfs(a, g, f, hit, who);
  }
}
vector<int> solve(vector<vector<int>> &g) {
  int n = g.size();
  vector<int> type(n, 0);
  vector<int> sol;
  for (int i = 0; i < n; i += 1) {
    type[i] = g[i].size() % 3;
    if (type[i] == 0) {
      for (int j = 0; j < n; j += 1)
        if (j != i) {
          sol.push_back(j);
        }
      return sol;
    }
  }
  for (int a = 0; a < n; a += 1)
    for (int b : g[a])
      if (type[a] == 1 and type[b] == 1) {
        for (int j = 0; j < n; j += 1)
          if (j != a and j != b) {
            sol.push_back(j);
          }
        return sol;
      }
  for (int a = 0; a < n; a += 1) {
    if (type[a] != 2) continue;
    vector<int> mates;
    for (auto b : g[a])
      if (type[b] == 1) mates.push_back(b);
    if (mates.size() >= 2) {
      for (int j = 0; j < n; j += 1) {
        if (j != a and j != mates[0] and j != mates[1]) {
          sol.push_back(j);
        }
      }
      return sol;
    }
  }
  vector<vector<int>> h(n);
  for (int a = 0; a < n; a += 1)
    for (int b : g[a])
      if (type[a] == 2 and type[b] == 2) h[a].push_back(b);
  vector<int> depth(n, -1);
  vector<int> color(n, -1);
  vector<int> f(n, -1);
  int c = 0;
  for (int i = 0; i < n; i += 1) {
    if (depth[i] < 0 and type[i] == 2) {
      depth[i] = 0;
      color[i] = c++;
      int minn = n + 1;
      int lower = -1, upper = -1;
      dfsCycle(i, h, depth, f, color, minn, lower, upper);
      if (lower >= 0 and upper >= 0) {
        int node = lower;
        vector<int> mark(n, 1);
        do {
          mark[node] = 0;
          node = f[node];
        } while (node != upper);
        mark[upper] = 0;
        for (int j = 0; j < n; j += 1)
          if (mark[j]) sol.push_back(j);
        return sol;
      }
    }
  }
  vector<int> touch(n, -1);
  for (int a = 0; a < n; a += 1) {
    if (type[a] != 1) continue;
    for (auto b : g[a]) touch[b] = a;
  }
  queue<int> q;
  vector<int> father(n, -1);
  for (int a = 0; a < n; a += 1)
    if (type[a] == 2 and touch[a] >= 0) {
      q.push(a);
      father[a] = a;
    }
  while (not q.empty()) {
    int node = q.front();
    q.pop();
    for (auto b : h[node]) {
      if (touch[b] < 0) {
        touch[b] = touch[node];
        father[b] = node;
        q.push(b);
      }
    }
  }
  for (int a = 0; a < n; a += 1)
    for (int b : h[a])
      if (touch[a] != touch[b]) {
        int x = a;
        int y = b;
        vector<int> mark(n, 1);
        do {
          mark[x] = 0;
          x = father[x];
        } while (father[x] != x);
        do {
          mark[y] = 0;
          y = father[y];
        } while (father[y] != y);
        mark[x] = 0;
        mark[y] = 0;
        mark[touch[a]] = mark[touch[b]] = 0;
        for (int j = 0; j < n; j += 1)
          if (mark[j]) sol.push_back(j);
        return sol;
      }
  vector<vector<int>> leaves(c);
  for (int a = 0; a < n; a += 1) {
    if (type[a] == 2 and h[a].size() == 1) {
      leaves[color[a]].push_back(a);
    }
  }
  vector<int> mark(n, 1);
  int one = touch[leaves[0].back()];
  vector<int> hit(n, 0);
  mark[one] = 0;
  for (auto b : g[one])
    if (type[b] == 2) hit[b] = 1;
  for (int i = 0; i < 2; i += 1) {
    vector<int> ff(n, -1);
    int x = leaves[i][0];
    int who = -1;
    ff[x] = x;
    hit[x] = 0;
    dfs(x, h, ff, hit, who);
    while (who != x) {
      mark[who] = 0;
      who = ff[who];
    }
    mark[x] = 0;
  }
  for (int i = 0; i < n; i += 1)
    if (mark[i]) sol.push_back(i);
  return sol;
}
int main() {
  ios_base ::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<int> type(n, 0);
    vector<vector<int>> g(n);
    for (int i = 0; i < m; i += 1) {
      int a, b;
      cin >> a >> b;
      a -= 1;
      b -= 1;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    vector<int> sol = solve(g);
    if (sol.empty()) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
      cout << sol.size() << "\n";
      for (auto temp : sol) cout << temp + 1 << " ";
      cout << "\n";
    }
  }
}
