#include <bits/stdc++.h>
using std::abs;
using std::bitset;
using std::cerr;
using std::cin;
using std::cout;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::unordered_map;
using std::unordered_set;
using std::vector;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using ld = long double;
template <typename T>
void _(const char* s, T h) {
  cerr << s << " = " << h << "\n";
}
template <typename T, typename... Ts>
void _(const char* s, T h, Ts... t) {
  int b = 0;
  while (((b += *s == '(') -= *s == ')') != 0 || *s != ',') cerr << *s++;
  cerr << " = " << h << ",";
  _(s + 1, t...);
}
struct init {
  init() {
    cin.tie(0);
    std::iostream::sync_with_stdio(0);
    cout << std::fixed << std::setprecision(10);
    cerr << std::fixed << std::setprecision(5);
  }
} init;
template <typename T, typename U>
void upx(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
void upn(T& x, U y) {
  if (x > y) x = y;
}
const ll N = 5e5 + 5;
vector<ll> g[N];
ll u[N];
ll vis = 0;
void dfs(ll v) {
  u[v] = 1;
  ;
  vis++;
  for (ll to : g[v]) {
    if (!u[to]) dfs(to);
  }
}
ll n, m;
ll fl;
void output(const vector<ll>& ans) {
  if (!fl) return;
  if (ans.size() == n || ans.size() == 0) {
    cout << "No\n";
  } else {
    cout << "Yes\n";
    cout << ans.size() << '\n';
    for (ll i : ans) cout << i << ' ';
    cout << '\n';
  }
}
vector<ll> way;
bool fnd(ll v) {
  u[v] = 2;
  way.emplace_back(v);
  vector<ll> qqq;
  qqq.push_back(v);
  vector<ll> pr(n + 1, -1);
  ll lst = 0;
  ll mem = -1;
  while (qqq.size() > lst) {
    ll vv = qqq[lst++];
    for (auto i : g[vv]) {
      if (u[i] != 2) {
        qqq.push_back(i);
        if (mem == -1 && g[i].size() % 3 == 1) mem = i;
        u[i] = 2;
        pr[i] = vv;
      }
    }
  }
  ll gd = (mem != -1);
  while (mem != -1) {
    way.push_back(mem);
    mem = pr[mem];
  }
  return gd;
}
ll rem[N];
void doans(vector<ll>& ans) {
  for (ll i = 1; i <= n; ++i)
    if (!rem[i]) ans.emplace_back(i);
}
vector<ll> g2[N];
ll dt[N];
ll col[N];
ll up[N];
ll curcol;
ll solved;
void dfs2(ll v, ll fr, ll dep = 0) {
  col[v] = curcol;
  dt[v] = dep;
  up[v] = fr;
  ll zhopa = -1;
  for (ll to : g2[v]) {
    if (!col[to]) {
    } else if (fr != to) {
      if (zhopa == -1 || dt[to] > dt[zhopa]) {
        zhopa = to;
      }
    }
  };
  if (!solved && zhopa != -1) {
    solved = 1;
    ll curv = v;
    while (curv != zhopa) {
      rem[curv] = 1;
      curv = up[curv];
    }
    rem[zhopa] = 1;
  }
  for (ll to : g2[v]) {
    if (!col[to]) {
      dfs2(to, v, dep + 1);
    }
  }
}
vector<ll> idet[N];
ll qwe[N];
bool ebat(ll v, ll tar, ll co) {
  qwe[v] = 1;
  vector<ll> qq;
  vector<ll> prr(N, -1);
  ll lst = 0;
  qq.push_back(v);
  while (lst < qq.size()) {
    ll vv = qq[lst++];
    for (auto i : g[vv]) {
      if (col[i] == co && !qwe[i]) {
        qq.push_back(i);
        prr[i] = v;
        qwe[i] = 1;
      }
    }
  }
  if (prr[tar] != -1) {
    ll nw = tar;
    while (prr[nw] != -1) {
      way.push_back(nw);
      nw = prr[nw];
    }
    way.push_back(nw);
    return 1;
  }
  return 0;
}
int32_t main() {
  ll te;
  cin >> te;
  fl = 1;
  ll fl2 = 1;
  ll memem = 0;
  ll kolll = 0;
  while (te--) {
    kolll++;
    memem++;
    vis = 0;
    ;
    cin >> n >> m;
    way.clear();
    for (ll i = 1; i <= n; ++i) {
      rem[i] = 0;
      u[i] = 0;
      g[i].clear();
      g2[i].clear();
      idet[i].clear();
      qwe[i] = 0;
      col[i] = 0;
    }
    for (ll i = 0; i < (m); ++i) {
      ll a, b;
      cin >> a >> b;
      g[a].emplace_back(b);
      g[b].emplace_back(a);
    }
    dfs(1);
    if (vis != n) {
      ;
      vector<ll> ans;
      for (ll i = 1; i <= n; ++i)
        if (u[i]) ans.emplace_back(i);
      output(ans);
      continue;
    }
    solved = 0;
    for (ll i = 1; !solved && i <= n; ++i) {
      if (g[i].size() % 3 == 0) {
        ;
        vector<ll> ans;
        for (ll j = 1; j <= n; ++j)
          if (i != j) ans.emplace_back(j);
        output(ans);
        solved = 1;
      }
    }
    if (solved) continue;
    ll a = 0, b = 0;
    for (ll i = 1; i <= n; ++i) {
      if (g[i].size() % 3 == 1) {
        if (a)
          b = i;
        else
          a = i;
      }
    }
    if (a && b) {
      ;
      if (!fl2) cout << "put 1";
      way.clear();
      fnd(a);
      for (ll i : way) {
        rem[i] = 1;
        ;
      }
      vector<ll> ans;
      doans(ans);
      output(ans);
      ;
      continue;
    }
    for (ll i = 1; i <= n; ++i) {
      for (ll to : g[i]) {
        if (g[i].size() % 3 == 2 && g[to].size() % 3 == 2) {
          g2[i].emplace_back(to);
          ;
        }
      }
    }
    curcol = 0;
    for (ll i = 1; !solved && i <= n; ++i) {
      if (g[i].size() % 3 == 2 && !col[i]) {
        curcol++;
        dfs2(i, i);
        if (solved) {
          ;
          if (!fl2) cout << "cyc 2";
          vector<ll> ans;
          doans(ans);
          output(ans);
        }
      }
    }
    if (solved) continue;
    for (ll to : g[a]) {
      idet[col[to]].emplace_back(to);
    }
    for (ll i = 1; i <= n; ++i)
      ;
    vector<ll> v0, v1, v2;
    for (ll i = 1; !solved && i <= curcol; ++i) {
      if (idet[i].size() % 3 == 0) {
        v0.emplace_back(i);
      } else if (idet[i].size() % 3 == 1) {
        v1.emplace_back(i);
      } else {
        v2.emplace_back(i);
      }
    }
    if (!v0.empty()) {
      ;
      assert(0);
      ll x = v0[0];
      vector<ll> ans;
      for (ll i = 1; i <= n; ++i)
        if (col[i] == x) ans.emplace_back(i);
      output(ans);
      continue;
    }
    if (!v1.empty() && !v2.empty()) {
      ;
      if (fl) cout << "comp12";
      assert(0);
      ll x = v1[0];
      ll y = v2[0];
      vector<ll> ans;
      for (ll i = 1; i <= n; ++i)
        if (col[i] == x || col[i] == y) ans.emplace_back(i);
      output(ans);
      continue;
    }
    if (v1.size() >= 3) {
      ;
      assert(0);
      ll x = v1[0];
      ll y = v1[1];
      ll z = v1[2];
      vector<ll> ans;
      for (ll i = 1; i <= n; ++i)
        if (col[i] == x || col[i] == y || col[i] == z) ans.emplace_back(i);
      output(ans);
      continue;
    }
    if (v2.size() >= 2) {
      ;
      if (!fl2) cout << "sraka";
      ll x = v2[0];
      ll y = v2[1];
      {
        way.clear();
        for (ll i = 1; i <= n; ++i) qwe[i] = 0;
        ll h1 = idet[x][0];
        ll h2 = idet[x][1];
        ebat(h1, h2, x);
        ;
        for (ll i : way) {
          rem[i] = 1;
          ;
        }
      }
      {
        way.clear();
        for (ll i = 1; i <= n; ++i) qwe[i] = 0;
        ll h1 = idet[y][0];
        ll h2 = idet[y][1];
        ll ewq = ebat(h1, h2, y);
        ;
        ;
        for (ll i : way) {
          rem[i] = 1;
          ;
        }
      }
      rem[a] = 1;
      ;
      vector<ll> ans;
      doans(ans);
      output(ans);
      continue;
    }
    cout << "No\n";
  }
  return 0;
}
