    #include <bits/stdc++.h>
                using namespace std;
                #define bust ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
                #define fr first
                #define sd second
                #define X real()
                #define Y imag()
                #define pb push_back
                typedef long long ll;
                typedef unsigned long long ull;
                typedef long double ld;
                #define FOR(i, a, b) for (int i = a; i < (b); ++i)
                #define F0R(i, b) for (int i = 0; i < (b); ++i)
                #define F1R(i, b) for (int i = 1; i < (b); ++i)
                #define FORd(i, a, b) for (int i = (b) - 1 ; i >= a; --i)
                #define F0Rd(i, b) for (int i = (b) - 1; i >= 0; --i)
                #define FORll(i, a, b) for (ll i = a; i < (b); ++i)
                #define F0Rll(i, b) for (ll i = 0; i < (b); ++i)
                #define F1Rll(i, b) for (ll i = 1; i < (b); ++i)
                #define FORdll(i, a, b) for (ll i = (b) - 1 ; i >= a; --i)
                #define F0Rdll(i, b) for (ll i = (b) - 1; i >= 0; --i)
                #define pr(qw) cout << (qw) << '\n'
                #define el pr('\n')
                #define pr2(s, q) cout << (s) << ' ' << (q) << '\n'
                #define ret return
                typedef pair<int, int> pii;
                typedef pair<long long, long long> pll;
                typedef complex<ll> C;
                const int nmax = 1e5 + 7;
                vector<int> a[nmax], g[nmax];
                int used[nmax];
                int n, m, root = 1, fl;
                void dfs(int v, int k, vector<int> vv){
                    used[v] = 1;
                    vv.pb(v);
                    if(fl==1) return;
                    if(k==n){
                        for(auto x: a[v]) if(x==1) { pr("YES"); for (auto y: vv) cout << y << ' '; pr(1); fl = 1;}
                        return;
                    }

                    for(auto x: a[v]){

                        if(used[x]==0){
                            dfs(x, k+1, vv);
                        }
                    }
                    used[v] = 0;
                }
                main(){
                    cin >> n >> m;
                    F0R(i, m){
                        int x, y;
                        cin >> x >> y;
                        a[x].pb(y);
                        g[y].pb(x);
                    }
                    vector<int> v = {};
                    dfs(1, 1, v);

                    if(fl == 0) pr("NO");









                }
