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

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


	int n, m;
	cin >> n >> m;
	if (n == 1) {
		cout << "NO\n";
		exit(0);
	}
	cout << "YES\n";
	unordered_set<string> st;
	st.reserve(m * 2);

	auto frmat = [](int a, int b) {
		return to_string(min(a, b)) + "-" + to_string(max(a, b));
	};

	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		st.insert(frmat(a, b));
	}

	int half = n / 2;
	for (int i = 1; i <= half; i++) {
		for (int j = i + 1; j <= half; j++) {
			string edge = frmat(i, j);
			if (!st.count(edge)) {
				cout << i << ' ' << j << '\n';
			}
		}
	}
	for (int i = half + 1; i <= n; i++) {
		for (int j = i + 1; j <= n; j++) {
			string edge = frmat(i, j);
			if (!st.count(edge)) {
				cout << i << ' ' << j << '\n';
			}
		}
	}

	return 0;
}