#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, m, root, d[N], p[N], h[N];
bool mark[N], good[N];
vector<int> adj[N];
string print_it;
queue<int> q;
bool dfs1(int u) {
  int mx = -1;
  mark[u] = true;
  for (auto v : adj[u])
    if (mark[v] && h[v] < h[u] - 1 && (!~mx || h[v] > h[mx])) mx = v;
  if (~mx && h[u] - h[mx] + 1 < n && d[mx] % 3 > 1) {
    for (; u ^ p[mx]; u = p[u]) good[u] = true;
    return true;
  }
  for (auto v : adj[u])
    if (!mark[v]) {
      h[v] = h[p[v] = u] + 1;
      if (dfs1(v)) return true;
    }
  return false;
}
void dfs2(int u) {
  mark[u] = true;
  for (auto v : adj[u])
    if (!mark[v]) dfs2(v);
}
inline bool have_3k_vertex() {
  for (int u = 0; u < n; u++)
    if (d[u] % 3 < 1 && n > 1) return good[u] = true;
  return false;
}
inline bool have_121_path() {
  if (root == n) return false;
  p[root] = -1, mark[root] = true;
  for (q.push(root); !q.empty(); q.pop()) {
    int u = q.front();
    for (auto v : adj[u])
      if (!mark[v]) {
        q.push(v);
        mark[v] = true;
        h[v] = h[p[v] = u] + 1;
      }
  }
  for (int u = root + 1; u < n; u++)
    if (d[u] % 3 == 1 && h[u] < n - 1) {
      for (; ~u; u = p[u]) good[u] = true;
      return true;
    }
  return false;
}
inline bool have_2_cycle() {
  p[root < n ? root : 0] = -1;
  fill(mark, mark + n, false);
  return dfs1(root < n ? root : 0);
}
inline bool have_122_components() {
  bool flag = false;
  if (root == n || d[root] < 5) return flag;
  fill(mark, mark + n, flag);
  mark[root] = good[root] = true;
  sort(adj[root].begin(), adj[root].end(),
       [](int u, int v) { return h[u] < h[v]; });
  for (auto u : adj[root])
    if (!mark[u] && h[u] > 1) {
      int v = u;
      while (p[v] ^ root) good[v = p[v]] = true;
      good[u] = true, dfs2(v);
      if (flag) break;
      flag = true;
    }
  return true;
}
inline void write_output() {
  for (int u = 0; u < n; u++)
    if (good[u]) {
      int deg = 0;
      for (auto v : adj[u]) deg += good[v];
      if (deg % 3 ^ d[u] % 3) {
        for (int i = 0; i < n; i++) m += d[i];
        cout << n << ' ' << m / 2 << endl;
        for (int i = 0; i < n; i++)
          for (auto j : adj[i])
            if (i < j) cout << i << ' ' << j << endl;
        exit(0);
      }
    }
  vector<int> vec;
  for (int u = 0; u < n; u++)
    if (!good[u]) vec.push_back(u);
  print_it += "Yes\n" + to_string(vec.size()) + '\n';
  for (auto u : vec) print_it += to_string(++u) + ' ';
  print_it += '\n';
}
inline void read_input() {
  for (cin >> n >> m; m--;) {
    int u, v;
    cin >> u >> v;
    d[--u]++, d[--v]++;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
}
inline void solve() {
  while (root < n && d[root] % 3 ^ 1) root++;
  if (have_3k_vertex() || have_121_path() || have_2_cycle() ||
      have_122_components())
    return write_output();
  print_it += "No\n";
}
inline void make_empty() {
  for (int u = root = 0; u < n; u++) {
    d[u] = h[u] = 0, adj[u].clear();
    mark[u] = good[u] = false;
  }
}
inline void shayan_this_is_for_you() {
  int t;
  cin >> t;
  while (t--) {
    read_input();
    solve();
    make_empty();
  }
  cout << print_it;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  shayan_this_is_for_you();
  return 0;
}
