#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, m, h[N], mn[N], par[N], t, num, op;
vector<int> adj[N];
set<int> answer, qtr;
bool finish, q[N];
struct edge {
  int u, v;
} ed[N];
void output() {
  if ((int)answer.size() == n) {
    cout << "NO" << '\n';
    finish = true;
    return;
  }
  cout << "YES" << '\n' << n - answer.size() << '\n';
  for (int i = 0; i < n; i++)
    if (!answer.count(i)) cout << i + 1 << ' ';
  cout << '\n';
  finish = true;
}
void haveDeg3() {
  for (int i = 0; i < n && !finish; i++)
    if (!(adj[i].size() % 3)) answer.insert(i), output();
}
void check() {
  for (int i = 0; i < m; i++) {
    if (adj[ed[i].u].size() % 3 == 1 && adj[ed[i].v].size() % 3 == 2) {
      if (q[ed[i].v]) {
        int x = ed[i].v;
        for (int i = 0; i < (int)adj[x].size() && answer.size() < 2; i++) {
          int z = adj[x][i];
          if (adj[z].size() % 3 == 1 && answer.size() < 2 && z != ed[i].u)
            answer.insert(z);
        }
        answer.insert(x), answer.insert(ed[i].u), output();
        return;
      }
      q[ed[i].v] = true;
    } else if (adj[ed[i].u].size() % 3 == 2 &&
               (int)adj[ed[i].v].size() % 3 == 1) {
      if (q[ed[i].u]) {
        int x = ed[i].u;
        for (int i = 0; i < (int)adj[x].size() && answer.size() < 2; i++) {
          int z = adj[x][i];
          if (adj[z].size() % 3 == 1 && answer.size() < 2 && z != ed[i].v)
            answer.insert(z);
        }
        answer.insert(ed[i].v), answer.insert(x), output();
        return;
      }
      q[ed[i].u] = true;
    } else if (adj[ed[i].u].size() % 3 == 1) {
      answer.insert(ed[i].u), answer.insert(ed[i].v), output();
      return;
    }
  }
}
void findCycle(int x) {
  for (auto v : adj[x])
    if (adj[v].size() % 2 == 2) {
      if (par[v] == -1)
        h[v] = h[x] + 1, mn[v] = h[v], par[v] = x;
      else
        mn[x] = min(mn[x], mn[v]);
    }
  if (mn[x] < h[x] - 1) {
    int z = mn[x];
    while (h[x] != z) answer.insert(x), x = par[x];
    answer.insert(x), output();
    return;
  }
  for (auto v : adj[x])
    if (par[v] == -1 && !finish && adj[v].size() % 2 == 2) {
      findCycle(v);
    }
}
void cycle() {
  for (int i = 0; i < n && !finish; i++)
    if (adj[i].size() % 3 == 2 && par[i] == -1) par[i] = -2, findCycle(i);
}
void dfsqtr(int x) {
  if (q[x] && par[x] != op) {
    if (qtr.count(x)) {
      while (x != op) {
        for (auto v : adj[x])
          if (par[v] == -1) par[v] = x;
        answer.insert(x), x = par[x];
      }
      num++;
      if (num > 1) {
        output();
        return;
      }
      dfsqtr(op);
    } else {
      answer.clear();
      answer.insert(op);
      for (auto v : adj[x])
        if (adj[v].size() % 3 == 1) {
          answer.insert(v);
          break;
        }
      while (x != op) answer.insert(x), x = par[x];
      output();
      return;
    }
  }
  for (int i = 0; i < (int)adj[x].size() && !finish; i++)
    if (par[adj[x][i]] == -1 && adj[x][i] != op)
      par[adj[x][i]] = x, dfsqtr(adj[x][i]);
}
void pick(int x) {
  qtr.clear();
  num = 0;
  for (auto v : adj[x]) qtr.insert(v);
  answer.insert(x);
  for (int i = 0; i < m; i++)
    if (adj[ed[i].u].size() % 3 == 1 && adj[ed[i].v].size() % 3 == 2)
      q[ed[i].v] = true;
    else if (adj[ed[i].u].size() % 3 == 2 && adj[ed[i].v].size() % 3 == 1)
      q[ed[i].u] = true;
  dfsqtr(op);
}
void another() {
  for (int i = 0; i < n; i++) par[i] = -1;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() % 3 == 1) {
      pick(op = i);
      return;
    }
  }
}
void readInput() {
  answer.clear();
  finish = false;
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    adj[i].clear(), h[i] = mn[i] = par[i] = -1, q[i] = false;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    ed[i].u = --x, ed[i].v = --y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
}
void solve() {
  haveDeg3();
  if (finish) return;
  check();
  if (finish) return;
  cycle();
  if (finish) return;
  another();
  if (finish) return;
  cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> t;
  while (t--) readInput(), solve();
  return 0;
}
