#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  int ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
void print(vector<int> x) {
  for (int i = 0; i < (int)x.size(); i++)
    printf("%d%c", x[i], " \n"[i == (int)x.size() - 1]);
}
vector<int> G[500005];
int n, m;
int dgr[500005], fa[500005], vis[500005], ok[500005], qwq[500005], OK,
    d[500005], dep[500005], qbq[500005];
bool tag;
void dfs(int u, int f) {
  fa[u] = f, vis[u] = 1, dep[u] = dep[f] + 1;
  if (OK) return;
  int minn = 0x3f3f3f3f, mid = 0;
  for (int v : G[u]) {
    if (v == f) continue;
    if (dgr[v] % 3 != 2) continue;
    if (vis[v] && abs(dep[u] - dep[v]) + 1 != n) {
      if (abs(dep[u] - dep[v]) + 1 < minn) {
        minn = abs(dep[u] - dep[v]) + 1, mid = v;
      }
    }
  }
  if (mid) {
    OK = 1;
    ok[mid] = 1;
    int tmp = u;
    while (tmp != mid) ok[tmp] = 1, tmp = fa[tmp];
    return;
  }
  for (int v : G[u]) {
    if (v == f) continue;
    if (dgr[v] % 3 != 2) continue;
    if (!vis[v]) dfs(v, u);
    if (OK) return;
  }
}
pair<vector<int>, int> getlef(int u, int ND) {
  for (int i = 1; i <= n; i++) qwq[i] = d[i] = fa[i] = 0;
  qwq[u] = 1;
  queue<int> q;
  q.push(u);
  vector<int> nd;
  nd.push_back(u);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v : G[u]) {
      if (dgr[v] % 3 == 2 && !qwq[v]) {
        qwq[v] = 1, vis[v] = 1;
        q.push(v);
        nd.push_back(v);
      }
    }
  }
  for (int i : nd) {
    for (int v : G[i]) {
      if (dgr[v] % 3 == 2) d[v]++;
    }
  }
  vector<int> lef;
  for (int i : nd)
    if (qbq[i] == 1) lef.push_back(i);
  assert(lef.size() >= 2);
  for (int i = 1; i <= n; i++) qwq[i] = 0;
  int QAQ = lef[0];
  qwq[QAQ] = 1;
  q.push(QAQ);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v : G[u]) {
      if (dgr[v] % 3 == 2 && !qwq[v]) {
        qwq[v] = 1;
        fa[v] = u;
        q.push(v);
        if (qbq[v] == 1) {
          vector<int> ans;
          int tmp = v;
          while (tmp != QAQ) {
            ans.push_back(tmp), tmp = fa[tmp];
          }
          ans.push_back(QAQ);
          return make_pair(ans, ans.size() == nd.size());
        }
      }
    }
  }
  assert(0);
}
void END() {
  OK = 0;
  for (int i = 1; i <= n; i++) G[i].clear();
  for (int i = 1; i <= n; i++)
    dgr[i] = 0, fa[i] = 0, vis[i] = 0, ok[i] = 0, qwq[i] = 0, d[i] = 0,
    qbq[i] = 0;
}
int cnt = 0;
void work() {
  cin >> n >> m;
  cnt++;
  if (cnt == 159 && tag) {
    printf("%d %d\n", n, m);
    for (int i = 1; i <= m; i++) {
      int x = read(), y = read();
      printf("%d %d\n", x, y);
    }
    return;
  }
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    G[u].push_back(v), G[v].push_back(u);
    dgr[u]++, dgr[v]++;
  }
  if (tag) return;
  if (n == 1) {
    cout << "NO\n";
    END();
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (dgr[i] % 3 == 0) {
      cout << "YES\n";
      cout << n - 1 << "\n";
      for (int j = 1; j <= n; j++)
        if (j != i) printf("%d ", j);
      cout << "\n";
      END();
      return;
    }
  }
  vector<int> one;
  for (int i = 1; i <= n; i++) {
    if (dgr[i] % 3 == 1) one.push_back(i);
  }
  if (one.size() > 1) {
    for (int i : one) qwq[i] = 1;
    int QAQ = one[0];
    vis[QAQ] = 1;
    queue<int> q;
    q.push(QAQ);
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (int v : G[u]) {
        if (vis[v]) continue;
        if (qwq[v]) {
          ok[v] = ok[QAQ] = 1;
          int tmp = u;
          while (tmp != QAQ) {
            ok[tmp] = 1;
            tmp = fa[tmp];
          }
          int sum = 0;
          for (int i = 1; i <= n; i++)
            if (!ok[i]) sum++;
          if (sum) {
            cout << "YES\n";
            cout << sum << "\n";
            for (int i = 1; i <= n; i++) {
              if (!ok[i]) printf("%d ", i);
            }
            cout << "\n";
            END();
            return;
          }
        }
        fa[v] = u, vis[v] = 1;
        q.push(v);
      }
    }
  }
  for (int i = 1; i <= n; i++) fa[i] = vis[i] = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && dgr[i] % 3 == 2) {
      dfs(i, 0);
      if (OK) {
        int sum = 0;
        for (int i = 1; i <= n; i++)
          if (!ok[i]) sum++;
        cout << "YES\n";
        cout << sum << "\n";
        for (int i = 1; i <= n; i++) {
          if (!ok[i]) printf("%d ", i);
        }
        cout << "\n";
        END();
        return;
      }
    }
  }
  for (int i = 1; i <= n; i++) fa[i] = vis[i] = 0;
  if (one.size() == 1) {
    int nd = one[0];
    for (int i : G[nd]) qbq[i] = 1;
    bool QaQ = 0;
    vector<pair<vector<int>, int>> v;
    for (int i = 1; i <= n; i++) {
      if (i == nd) continue;
      if (vis[i]) continue;
      v.push_back(getlef(i, nd));
      if (!QaQ && v.size() == 2 && v[0].second == 1 && v[1].second == 1)
        v.pop_back(), QaQ = 1;
      if (v.size() == 2) {
        ok[nd] = 1;
        for (int i : v[0].first) ok[i] = 1;
        for (int i : v[1].first) ok[i] = 1;
        int sum = 0;
        for (int i = 1; i <= n; i++)
          if (!ok[i]) sum++;
        cout << "YES\n";
        cout << sum << "\n";
        for (int i = 1; i <= n; i++) {
          if (!ok[i]) printf("%d ", i);
        }
        cout << "\n";
        END();
        return;
      }
    }
  }
  cout << "NO\n";
  END();
}
signed main() {
  int T = read();
  if (T == 34273) tag = 1;
  while (T--) work();
  return 0;
}
