#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;

using namespace std;

#define FOR(i, n) for(int i=0; i<n; ++i)
#define FOR2(i, a, b) for(ll i=a; i<b; ++i)
#define RFOR(i, n) for(int i=n-1; i>=0; --i)
#define FORA(i, a) for(auto i : a)
#define FORAR(i, a) for(auto & i : a)
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define V vector
#define P pair
#define S set
#define elif else if
#define str string
#define pb push_back
#define OK cout<<"OK\n";
#define watch(x) (#x) << " -> " << x

int n, m;
int kv = 0;
bool vse = 0;
V<char> us(1e5);
V<int> vid;
V<V<int>> c;
V<V<int>> inf;

void dfs(int v){
	FORAR(i, inf[v])
		if(us[i])
			return;
	FORAR(i, inf[v])
		us[i] = 1;
	kv += inf[v].size();
	vid.pb(v);
	if(kv == n){
		bool b = 0;
		FORAR(i, c[v])
			b |= (i == 1);
		if(b){
			cout << "YES\n";
			vse = 1;
			FORAR(i, vid)
				FORAR(j, inf[i])
					cout << j << ' ';
			cout << "1\n";
		}
	}
	FORAR(i, c[v]){
		if(!vse)
			dfs(i);
	}
	FORAR(i, inf[v])
		us[i] = 0;
	kv += inf[v].size();
	vid.pop_back();
}

int main(){
	fast;

	cin >> n >> m;

	c.resize(n+1);
	inf.resize(n+1);

	FOR(i, m){
		int a, b;
		cin >> a >> b;
		c[a].pb(b);
	}

	FOR(i, n){
		inf[i].pb(i);
	}

	FOR(i, n){
		if(c[i].size() == 1 and c[i][0] != 1){
			inf[i].pb(c[i][0]);
			c[i] = c[c[i][0]];
			--i;
		}
	}

	dfs(1);

	if(!vse)
		cout << "NO\n";
}