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

#define vt vector
#define ll long long
#define rall(x) (x).rbegin(), (x).rend()
#define all(x) (x).begin(), (x).end()

const char nl = '\n';

void solve()
{
    int N, M;
    cin >> N >> M;

    cout << "YES" << nl;
    cout << 2 * M << nl;
    for(int i = 0; i < M; i++)
    {
        int a, b;
        cin >> a >> b, --a, --b;
        vt<bool> print(N, true);
        print[a] = print[b] = false;
        cout << 1 + a << " " << 1 + b << " ";
        for(int i = 0; i < N; i++)
            if(print[i])
                cout << i + 1 << " ";
        cout << nl;
        for(int i = N - 1; i >= 0; i--)
            if(print[i])
                cout << i + 1 << " ";


        cout << 1 + a << " " << 1 + b << nl;
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    solve();
}