#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define all(x) begin(x), end(x)
#define sz(x) int((x).size())
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

#ifdef LOCAL
auto operator<<(auto& o, auto x) -> decltype(x.first, o);
auto operator<<(auto& o, auto x) -> decltype(x.end(), o) {
  o << "{";
  for (int i = 0; auto y : x) o << ", " + !i++ * 2 << y;
  return o << "}";
}
auto operator<<(auto& o, auto x) -> decltype(x.first, o) {
  return o << "(" << x.first << ", " << x.second << ")";
}
void __print(auto... x) { ((cerr << x << " "), ...) << endl; }
#define debug(x...) __print("[" #x "]:", x)
#else
#define debug(...) 2137
#endif

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, m;
  cin >> n >> m;


  vector<vector<int>> ans;

  for(int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    vi an;
    an.emplace_back(a);
    an.emplace_back(b);
    
    for(int j = 1; j <= n; j++) {
      if(j != a && j != b)
        an.emplace_back(j);
    }

    ans.emplace_back(an);

  }
  debug(n, m);
  debug(ans);

  auto pt = [&] (vi &ve) {
    for(int i = 0; i < sz(ve); i++)
      cout << ve[i] << (i == sz(ve) - 1 ? "\n" : " ");
  };

  cout << "YES" << endl;
  cout << ans.size() * 4 << endl;
  for(auto i : ans) {
    debug(i);
    pt(i);
    reverse(2 + all(i));
    pt(i);
    reverse(2 + all(i));
    reverse(all(i));
    swap(i[n - 1], i[n - 2]);
    pt(i);
    reverse(all(i) - 2);
    pt(i);
  }


}