function Scanner(input) {
	var self = this;
	self.itemNo = 0;
	self.orgStr = input;
	self.splitedStrs = (function(target) {
		var result = [];
		var target = target.replace(/[\n \t]+/g, " ");
		var strs = target.split(" ");
		for (var i = 0, len = strs.length; i < len; i++) {
			result.push(strs[i]);
		}
		return result;
	}(input));

	self.next = function() {
		var result = self.splitedStrs[self.itemNo];
		self.itemNo++;
		return (result != null) ? result : null;
	}

	self.nextInt = function() {
		var result = self.splitedStrs[self.itemNo];
		self.itemNo++;
		return (result != null) ? parseInt(result) : null;
	}

	self.nextBigDecimal = function() {
		var result = self.splitedStrs[self.itemNo];
		self.itemNo++;
		return (result != null) ? parseFloat(result) : null;
	}
	
	self.nextByte = function() {
		var result = self.splitedStrs[self.itemNo];
		self.itemNo++;
		return (result != null) ? new Int8Array(result) : null;
	}

}

function Main(sc) {

	var N = sc.nextInt();
	var M = sc.nextInt();
	var canThrouth = true;
	var anss = [];
	
	var path = {};
	for (var i = 0; i < M; i++) {
		var A = sc.nextInt();
		var B = sc.nextInt();
		path[A] = (path[A] == null) ? [B] : path[A].concat([B]);
		path[B] = (path[B] == null) ? [A] : path[B].concat([A]);
	}
	
	crawlCell = function (thisNo, throuPath) {
		
		if (thisNo == 1) {
			if (couldThrouthPath == null) {
				couldThrouthPath = throuPath;
			}
			else {
				if (couldThrouthPath.length > throuPath.length) {
					couldThrouthPath = throuPath;
				}
			}
		} else {
		
			throuPath.push(thisNo);
			var nextList = (path[thisNo] == null) ? [] : path[thisNo].concat();
			// nextListから既に通ったものを排除
			for (var i = 0; i < throuPath.length; i++) {
				var idx = nextList.indexOf(throuPath[i]);
				if (idx > -1) {
					nextList.splice(idx, 1);
				}
			}
			
			for (var i = 0; i < nextList.length; i++) {
				crawlCell(nextList[i], throuPath);
			}
		}
	}
	
	for (var j = 0; j < N; j++) {
		var cellNo = j + 1;
		couldThrouthPath = null;
		crawlCell(cellNo, []);
		if (couldThrouthPath == null) {
			canThrouth = false;
			break;
		}
		else {
			anss.push(couldThrouthPath[0]);
		}
	}
	
	
	console.log((canThrouth) ? "Yes" + anss.join("\n") : "No");
}
Main(new Scanner(require("fs").readFileSync("/dev/stdin", "utf8")));
// Main(new Scanner("10 1 2 5 3 4 6 7 3 2 4 1 2 2 3 3 4 4 5 3 6 6 7 1 8 8 9 9 10"));

// var str1 = sc.next(); // Stringで取得
// var int1 = sc.nextInt(); // intで取得
// var bd1 = sc.nextBigDecimal(); // BigDecimalで取得
// var byte1 = sc.nextByte(); // byteで取得
// for (var i = 0; i < 1000000000; i++) var toDelay = "aaa"; // 1000msくらいの遅延
// console.log(wrtnNos); return;
