#include <bits/stdc++.h> using namespace std; using ll = long long; using LL = long long; using i64 = long long; void solve() { ll n, m; cin >> n >> m; vector <vector <ll>> e(n, vector <ll> (n, 0)); for (int i = 0; i < m; i++){ ll x, y; cin >> x >> y; x--; y--; if (x < y)e[x][y] = 1; else e[y][x] = -1; } for (int i = 0; i < n; i++){ for (int j = i+1; j < n; j++)if (e[i][j] == 0)e[i][j] = 1; } vector <pair <ll, ll>> s; for (int i = 0; i < n; i++){ for (int j = i+1; j < n; j++){ if (e[i][j] == 1)s.push_back({i, j}); else s.push_back({j, i}); } } cout << "YES\n" << 2*s.size() << "\n"; for (auto p : s){ vector <ll> v; for (int i = 0; i < n; i++)if (i != p.first && i != p.second)v.push_back(i); for (auto x : v)cout << x+1 << " "; cout << p.first+1 << " " << p.second+1 << "\n"; reverse(v.begin(), v.end()); for (auto x : v)cout << x+1 << " "; cout << p.first+1 << " " << p.second+1 << "\n"; } } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t = 1; while (t--) solve(); }