#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;

void dfs(V<V<int>> & c, int v){
	if(us[v])
		return;
	us[v] = 1;
	++kv;
	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)
				cout << i << ' ';
		}
	}
	FORAR(i, c[v]){
		if(!vse)
			dfs(c, i);
	}
	us[v] = 0;
	--kv;
	vid.pop_back();
}

int main(){
	fast;

	cin >> n >> m;

	V<V<int>> c(n+1);

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

	dfs(c, 1);

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