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

#define all(x) ::begin(x), ::end(x)
#define tsolve int t; cin >> t; while (t--) solve
#define sz(x) (int)::size(x)
using ll = long long;
using ld = long double;

void solve() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> ans;
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        a--, b--;
        vector<int> v = {a, b};
        for(int j = 0; j < n; j++){
            if(j != a && j != b) v.push_back(j);
        }
        ans.push_back(v);
        swap(v[0], v[1]);
        reverse(all(v));
        ans.push_back(v);
    }
    cout << "YES\n";
    cout << sz(ans) << "\n";
    for(auto v : ans){
        for(int x : v) cout << x+1 << " ";
        cout << "\n";
    }
}

int main() {
    cout.tie(0)->sync_with_stdio(false);
    cout << setprecision(16);
    solve();
}