#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;

#define sz(x) (int)(x).size()
#define ins insert
#define pb push_back
#define ff first
#define ss second
#define bust ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define nl '\n'
ll n, m;
bool used[100007];
vvl g;
vl res;
bool dfs(ll v, ll cnt){
    if(v == 0 && cnt == n){
        res.pb(0);
        return true;
    }
    used[v] = 1;
    for(auto to : g[v]){
        if(!used[to]){
            ll tek = dfs(to, cnt+1);
            if(tek){
                res.pb(v);
                return true;
            }
        }
    }
    used[v] = false;
    return false;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin >> n >> m;
    g.resize(n);
    vvl g_t(n);
    for(int i = 0; i < m; ++i){
        ll v, to;
        cin >> v >> to;
        --v;
        --to;
        g[v].pb(to);
        g_t[to].pb(v);
    }
    bool flag = false;
    for(int i = 0; i< n; i++){
        if(!g[i].size() || !g_t[i].size()){
            flag = true;
        }
    }
    if(m < n || flag){
        cout << "NO\n";
        return 0;
    }
    for(auto to : g[0]){
        if(!used[to]){
            if(dfs(to, 1)){
                res.pb(0);
                break;
            }
        }
    }
    if(res.size()){
        reverse(res.begin(), res.end());
        cout << "YES\n";
        for(auto e: res){
            cout << e+1 << " ";
        }
    }
    else cout << "NO\n";
    return 0;
}