#include <bits/stdc++.h>

using namespace std;

//#define int long long

typedef long long ll;
typedef long double ld;

void solve() {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> lst(m);
    for (int i =0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        lst[i] = {a, b};

    }
    cout << "YES\n";
    cout << m * 2 << '\n';
    for (int i =0; i < lst.size(); i++) {
        cerr << lst[i].first << " " << lst[i].second << '\n';
    }
    for (int i =0; i < m; i++) {
        cout << lst[i].first << " " << lst[i].second << " ";


        for (int j = 1; j <= n; j++) {
            if (j == lst[i].first || j == lst[i].second) {
                continue;
            }
            cout << j << " ";
        }
        cout << '\n';
        for (int j = n; j >= 1; j--) {
            if (j == lst[i].first || j == lst[i].second) {
                continue;
            }
            cout << j << " ";
        }
        cout << lst[i].first << " " << lst[i].second << "\n";
    }
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LC
    freopen("/home/team11/CLionProjects/contest/input.txt", "r", stdin);
    freopen("/home/team11/CLionProjects/contest/output.txt", "w", stdout);

#endif
    int t= 1 ;
    //cin >> t;
    for (int tt =0; tt <t; tt++) {
        solve();
    }
    return 0;
}