#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
int n, m;
bool vis[N];
int cc;
vector<pair<int, int> > g[N];
vector<vector<int> > ans;
vector<int> tmp, _;
int layer[N], leader[N];
vector<pair<int, int> > comp;
bool vis2[N], vis3[N << 1];
void dfs(int c, int fa, int lineid) {
  vis[c] = true;
  vis2[layer[c]] = true;
  tmp.push_back(c);
  for (int i = 0; i < (int)(g[c]).size(); ++i) {
    int t = g[c][i].first;
    if (g[c][i].second == lineid) continue;
    if (!vis[t]) {
      dfs(t, c, g[c][i].second);
      tmp.push_back(c);
      for (; cc >= 0 && vis2[comp[cc].second]; --cc)
        ;
      if (cc >= 0) {
        vis3[g[c][i].second] = true;
        int t = leader[comp[cc].second];
        ans.push_back(tmp);
        tmp.clear();
        _.clear();
        _.push_back(g[c][i].second);
        _.push_back(c);
        _.push_back(t);
        ans.push_back(_);
        dfs(t, c, g[c][i].second);
        tmp.push_back(c);
      }
    } else {
      if (vis3[g[c][i].second]) continue;
      for (; cc >= 0 && vis2[comp[cc].second]; --cc)
        ;
      if (cc >= 0) {
        vis3[g[c][i].second] = true;
        int t = leader[comp[cc].second];
        ans.push_back(tmp);
        tmp.clear();
        _.clear();
        _.push_back(g[c][i].second);
        _.push_back(c);
        _.push_back(t);
        ans.push_back(_);
        dfs(t, c, g[c][i].second);
        tmp.push_back(c);
      }
    }
  }
}
void out() {
  puts("YES");
  printf("%d\n", (int)(ans).size() / 2);
  for (int i = 0; i < (int)(ans).size(); ++i) {
    if (i & 1)
      printf("%d %d %d\n", ans[i][0] + 1, ans[i][1] + 1, ans[i][2] + 1);
    else {
      printf("%d", (int)(ans[i]).size());
      for (int j = 0; j < (int)(ans[i]).size(); ++j)
        printf(" %d", ans[i][j] + 1);
      printf("\n");
    }
  }
}
int findBridge() {
  fill(vis + 1, vis + n, false);
  fill(vis3, vis3 + m, false);
  for (int i = 1; i < n; ++i)
    if (!vis[i]) {
      vector<int> v;
      v.push_back(i);
      vis[i] = true;
      for (int j = 0; j < (int)(v).size(); ++j) {
        int c = v[j];
        for (int k = 0; k < (int)(g[c]).size(); ++k) {
          int t = g[c][k].first, id = g[c][k].second;
          if (vis3[id]) continue;
          vis3[id] = true;
          if (vis[t])
            return g[c][k].second;
          else
            vis[t] = true, v.push_back(t);
        }
      }
    }
  return -1;
}
int getblock(int l, int r) {
  fill(vis + l, vis + r, false);
  int block = 0;
  comp.clear();
  for (int i = l; i < r; ++i)
    if (!vis[i]) {
      ++block;
      vector<int> V;
      V.push_back(i);
      vis[i] = true;
      for (int j = 0; j < (int)(V).size(); ++j) {
        int c = V[j];
        for (int k = 0; k < (int)(g[c]).size(); ++k) {
          int t = g[c][k].first;
          if (!vis[t]) vis[t] = true, V.push_back(t);
        }
      }
      for (int j = 0; j < (int)(V).size(); ++j) layer[V[j]] = block - 1;
      leader[block - 1] = V[0];
      comp.push_back(make_pair((int)(V).size(), block - 1));
    }
  sort((comp).begin(), (comp).end());
  return block;
}
void go(int id) {
  int c = 0;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < (int)(g[i]).size(); ++j)
      if (g[i][j].second == id) {
        if ((int)(g[i]).size() >= 2) c = i;
        g[i].erase(g[i].begin() + j, g[i].begin() + j + 1);
        break;
      }
  }
  getblock(1, n);
  cc = (int)(comp).size() - 1;
  fill(vis, vis + n, false);
  fill(vis2, vis2 + n, false);
  fill(vis3, vis3 + m, false);
  vis[0] = true;
  _.clear();
  _.push_back(0);
  ans.push_back(_);
  _.clear();
  _.push_back(id);
  _.push_back(0);
  _.push_back(c);
  ans.push_back(_);
  dfs(c, 0, -1);
  if ((int)(tmp).size()) ans.push_back(tmp), tmp.clear();
  out();
}
int main() {
  scanf("%d%d", &n, &m);
  int u, v;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    --u;
    --v;
    g[u].push_back(make_pair(v, i));
    g[v].push_back(make_pair(u, i));
  }
  if (n == 1) {
    printf("YES\n0\n1 1\n");
    return 0;
  }
  int block = getblock(0, n);
  if (m < block - 1)
    puts("NO");
  else {
    if ((int)(g[0]).size()) {
      fill(vis, vis + n, false);
      fill(vis2, vis2 + n, false);
      fill(vis3, vis3 + m, false);
      cc = (int)(comp).size() - 1;
      dfs(0, -1, -1);
      if ((int)(tmp).size()) ans.push_back(tmp), tmp.clear();
      out();
    } else {
      int id = findBridge();
      if (id == -1) {
        if (m < block)
          puts("NO");
        else {
          for (int i = 1; i < n; ++i)
            if ((int)(g[i]).size() > 1) {
              id = g[i][0].second;
              break;
            }
          if (id == -1)
            puts("NO");
          else
            go(id);
        }
      } else {
        go(id);
      }
    }
  }
  return 0;
}
