#include <bits/stdc++.h>

#define ll long long
#define all(x) x.begin(), x.end()
#define ve vector
#define vi vector<int>
#define vvi vector<vector<int>>
#define pb push_back


using namespace std;

template <class T>
istream& operator >>(istream&in, vector<T>&v) {
    for(T&el : v) {
        in >> el;
    }
    return in;
}

template <class T>
ostream& operator <<(ostream&out, vector<T>&v) {
    out <<"{";
    for(T&el : v) {
        out << el << ' ';
    }
    out <<"}";
    return out;
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    vvi res;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        --u, --v;
        vi ar1 = {u, v};
        for (int i = 0; i < n; ++i) {
            if (i != u && i != v) {
                ar1.pb(i);
            }
        }
        res.pb(ar1);
        ar1.clear();
        for (int i = n - 1; i >= 0; --i) {
            if (i != u && i != v) {
                ar1.pb(i);
            }
        }
        ar1.pb(u);
        ar1.pb(v);
        res.pb(ar1);
    }
    cout << "YES\n" << res.size() << "\n";
    for (vi& x : res) {
        for (int i : x) cout << i+1 << ' ';
        cout << "\n";
    }
}