	#include <algorithm>
	#include <iostream>
	#include <cstdlib>
	#include <cstdarg>
	#include <cassert>
	#include <climits>
	#include <cstring>
	#include <complex>
	#include <cstdio>
	#include <vector>
	#include <string>
	#include <queue>
	#include <cmath>
	#include <ctime>
	#include <set>
	#include <map>
	#include <iomanip>
	#include <unordered_map>
	#include <bitset>
	#include<stack>
	#include <type_traits>
	#include <random>
	#include <chrono>
	#define int long long
	using namespace std;
	long long a, b, c, d, e, f, g;
	vector<vector<int> > v(1000001);
	vector<int> v2;
	bool us[1000005];
	bool flag = 0;
	void rec(int x)
	{
		//cout << x << " "<<v2.size()<<'\n';
		if (flag == 1) return;
		if (v2.size() == a)
		{
			for (int i = 0; i < v[x].size(); i++)
			{
				//cout << v[x][i] << " ";
				if (v[x][i] == 1)
				{
					flag = 1;
					cout << "YES\n";
					for (int j = 0; j < v2.size(); j++)

					{
						cout << v2[j] << " ";
					}
					cout << 1 << '\n';
					return;
				}
			}
			cout << '\n';
		}
		else
		{
			for (int i = 0; i < v[x].size(); i++)
			{
				int to = v[x][i];
				//cout << to << " "<<x<<"A\n";
				if (us[to] == 0)
				{
					us[to] = 1;
					v2.push_back(to);
					rec(to);
					if (flag == 1) return;
					v2.pop_back();
					us[to] = 0;
				}
			}
		}
	}
	void solve()
	{
		cin >> a >> b;
		for (int i = 1; i <= b; i++)
		{
			cin >> c >> d;
			v[d].push_back(c);
			v[c].push_back(d);
		}
		us[1] = 1;
		v2.push_back(1);
		rec(1);
		if (flag==0) cout << "NO\n";
	}
	/*
	6
	3 3 3 3 4 5
	*/
	signed main() {
		int q = 1;
		//cin >> q;
		while (q != 0)
		{
			solve();
			q--;
		}
	}
