#include <bits/stdc++.h>
#define st first
#define nd second
using namespace std;
int const mxn = 100;

vector<pair<int,int> > edge;
mt19937 _rand(time(NULL));

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < m; i ++){
        int u, v;
        cin >> u >> v;
        edge.push_back({u, v});
    }
    cout << "YES" << endl;
    cout << 2 * m << endl;
    for(auto e : edge){
        cout << e.st<<' '<<e.nd<<' ';
        for(int i = 1; i <= n; i ++){
            if(i == e.st || i == e.nd) continue;
            cout << i << ' ';
        }
        cout << endl;
        for(int i = n; i >= 1; i --){
            if(i == e.st || i == e.nd) continue;
            cout << i << ' ';
        }cout << e.st<<' '<<e.nd<<endl;
    }
    return 0;
}