#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")

using namespace std;

using ll = long long;
using ld = long double;

ll n, m, k, q, x, y, z, a, b, c, d;
string s;
vector<ll> G[100000];
ll nxt[100000];
ll mp[100000];
unordered_set<ll> used;
bitset<100000> st;
bool vis[100000];

inline ll hsh(ll a, ll b) {
    return (a << 20) + b;
}

void dfs2(ll x) {
    if (vis[x]) {
        return;
    }
    vis[x] = 1;
    st.set(x);
    for (ll to : G[x]) {
        dfs2(to);
    }
}

ll dfs(ll x, bitset<100000> &us) {
    ll ans = -1;
    for (int to : G[x]) {
        if (to == 0) {
            if (ans < 1) {
                ans = 1;
                nxt[x] = to;
            }
        }
        else if (!us[to]) {
            used.insert(hsh(x, to));
            us.set(to);
            ll y = dfs(to, us);
            if (y != -1) {
                if (y + 1 > ans) {
                    nxt[x] = to;
                }
                ans = max(ans, y + 1);
            }
            us.reset(to);
        }
    }
    mp[x] = ans;
    return ans;
}

void solve() {
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        nxt[i] = -1;
        mp[i] = -1;
    }
    for (int i = 0; i < m; i++) {
        cin >> a >> b;
        a--;
        b--;
        G[a].push_back(b);
    }
    dfs2(0);
    if (st.count() != n) {
        cout << "NO\n";
        return;
    }
    bitset<100000> us;
    us.set(0);
    ll x = dfs(0, us);
    if (x == n) {
        cout << "YES\n";
        ll y = nxt[0];
        cout << 1 << ' ';
        while (y != 0) {
            cout << y + 1 << ' ';
            y = nxt[y];
        }
        cout << 1 << '\n';
    }
    else {
        cout << "NO\n";
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << fixed;
    cout << setprecision(10);
    solve();
}
