#include <bits/stdc++.h> using namespace std; const int maxn = 55; bool has[maxn][maxn]; vector <vector <int> > ans; int n; void solve(int a, int b) { int i; vector <int> p; p.resize(n); p[0] = a; p[1] = b; int k = 2; for(i = 1; i <= n; i++) { if (i != a && i != b) p[k++] = i; } ans.push_back(p); k = 0; for(i = n; i >= 1; i--) { if (i != a && i != b) p[k++] = i; } p[k++] = a; p[k++] = b; ans.push_back(p); } int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int m; cin >> n >> m; int a, b; for (int i = 1; i <= m; i++) { cin >> a >> b; has[a][b] = true; if (has[b][a]){cout << "NO" << endl; return 0;} solve(a,b); } cout << "YES" << endl; cout << ans.size() << endl; for (auto &p : ans){ for (auto &t : p) { cout << t << " "; } cout << endl; } return 0; }