#include <bits/stdc++.h> using namespace std; #define endl '\n' int main() { cin.tie(0)->sync_with_stdio(0); int n, m; cin >> n >> m; cout<<"YES"<<endl; cout<<2*m<<endl; for (int i = 1; i <= m; i++) { int u, v; cin >> u >> v; vector<int> a; for(int j=1;j<=n;++j) if(j!=u&&j!=v) a.push_back(j); cout<<u<<" "<<v<<" "; for(int x:a) cout<<x<<" "; cout<<endl; reverse(a.begin(),a.end()); for(int x:a) cout<<x<<" "; cout<<u<<" "<<v<<" "; cout<<endl; } return 0; }