#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n, m;
bool alarm=0, color[100005]={0};
vector <ll> v[100005];
vector <ll> way(100005);
void dfs(ll h, ll q);
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	for(int x, y, i=0;i<m;i++) {
		cin >> x >> y;
		v[x].push_back(y);
	}
	way[0] = 1;
	dfs(1, 1);
	if(alarm) {
		cout << "YES\n";
		for(int i=0;i<n;i++)
			cout << way[i] << " ";
		cout << 1;
	}
	else
		cout << "NO";
	return 0;
}
void dfs(ll h, ll q) {
	if(h==n) {
		for(auto x : v[q]) {
			if(x == 1)
				alarm = 1;
		}
	}
	if(!alarm) {	
		for(auto x : v[q]) {
			if(!color[x]) {
				color[x] = 1;
				way[h] = x;
				dfs(h+1, x);
				color[x] = 0;
			}
		}
	}
}