#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,tune=native")

#include <iostream>
#include <vector>
#include <set>
#include <cmath>
#include <numeric>
#include <map>
#include <cassert>
#include <algorithm>
#include <random>

using namespace std;

#define int long long

vector<vector<int>> adj;
vector<bool> used;
vector<int> p;
int d = 0;
int ansv = -1;
int start;
int tim = 0;

int dfs(int v, int pr)
{
	++tim;
	used[v] = 1;
	p[v] = pr;
	++d;
	for (int i = 0; i < adj[v].size(); ++i)
	{
		if (tim >= 1e7) return 0;
		if (adj[v][i] == start && d == adj.size() && ansv == -1)
		{
			ansv = v;
			return 1;
		}
		if (used[adj[v][i]]) continue;
		if (dfs(adj[v][i], v)) return 1;
	}
	--d;
	used[v] = 0;
	return 0;
}

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	srand(time(0));
	int n, m, c1, c2;
	cin >> n >> m;
	adj.resize(n);
	used.resize(n);
	p.resize(n);
	start = rand() % n;
	
	for (int i = 0; i < m; ++i)
	{
		cin >> c1 >> c2;
		--c1;
		--c2;
		adj[c1].push_back(c2);
	}
	bool x = dfs(start, -1);
	if (!x)
	{
		used = vector<bool>(n);
		tim = 0;
		start = rand() % n;
		d = 0;
		p = vector<int>(n);
		x = dfs(start, -1);
	}
	cout << (x ? "YES" : "NO") << '\n';
	if (d == n)
	{
		vector<int> ans;
		ans.push_back(ansv + 1);
		while (p[ansv] != -1)
		{
			ans.push_back(1 + p[ansv]);
			ansv = p[ansv];
			//cout << ans[ans.size() - 1] << '\n';
		}
		reverse(ans.begin(), ans.end());
		int k = -1;
		for (int i = 0; i < n; ++i)
		{
			if (ans[i] == 1)
			{
				k = i;
				break;
			}
		}
		vector<int> rans;
		for (int i = k; i < n; ++i) rans.push_back(ans[i]);
		for (int i = 0; i <= k; ++i) rans.push_back(ans[i]);
		for (int i = 0; i <= n; ++i) cout << rans[i] << " ";
		cout << '\n';
	}
	return 0;
}
