import sys
sys.setrecursionlimit(10 ** 3)

def readList():
    return [int(i) for i in input().split()]

def newdfs(u):
	global graph
	global used
	global ans
	global n

	ans.append(u)
	if len(ans) == n:
		#print(graph)
		#print(graph[ans[-1]])
		#print(graph[ans[-1]].get(ans[0], 0))
		if graph.get(ans[-1], {}).get(ans[0], 0) == 1:
			return 1 
		#print(ans)
		ans.pop()
		return 0

	used[u] = 1
	for v in range(1, n + 1):
		#print(v, used)
		if not used[v]:
			#print(graph[u], graph[u].get(v, 0))
			if graph.get(u, {}).get(v, 0) == 1: 
				if newdfs(v):
					return 1 
	ans.pop()
	used[u] = 0
	#print(used, ans)
	return 0

n, m = readList()
graph = {}
for i in range(m):
	a, b = readList()
	if graph.get(a, 0) == 0:
		graph[a] = {b: 1}
	else:
		graph[a][b] = 1

used = [0] * (n + 1)
ans = []

if m <= 10 ** 5:
	if newdfs(1):
		#print(used)
		print('YES')
		print(*ans, end = ' 1')
	else:
		print('NO')
else:
	print('NO')