#include <bits/stdc++.h>

using namespace std;
using ll = int64_t;

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

	int n;
	cin >> n;
	int m;
	cin >> m;
	vector<pair<int, int>> es;
	for(int i = 0; i < m; ++i) {
		int a, b;
		cin >> a >> b;
		--a; --b;
		es.push_back({a, b});
	}

	vector<vector<int>> ress;
	for(auto[a, b] : es) {
		vector<int> others;
		for(int i = 0; i < n; ++i) {
			if(a != i && b != i) others.push_back(i);
		}
		vector<int> res;
		res = others;
		res.push_back(a);
		res.push_back(b);
		ress.push_back(std::move(res));
		res.clear();
		res.push_back(a);
		res.push_back(b);
		for(int x : others) {
			res.push_back(x);
		}
		ress.push_back(std::move(res));
		res.clear();
		reverse(begin(others), end(others));
		res = others;
		res.push_back(a);
		res.push_back(b);
		ress.push_back(std::move(res));
		res.clear();
		res.push_back(a);
		res.push_back(b);
		for(int x : others) {
			res.push_back(x);
		}
		ress.push_back(std::move(res));
	}


	cout << "YES\n";
	cout << ress.size() << '\n';

	for(auto& r : ress) {
		for(int x : r) {
			cout << x+1 << ' ';
		}
		cout << '\n';
	}

	return 0;
}