#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const int N = 1e5 + 30;
vector < int > g[N], gg;
queue < int > q;
int d[N];

int check (int vv, int w) {
    if (w == -1) return 1;
    while (!q.empty ()) q.pop ();
    q.push (vv);
    while (!q.empty ()) {
        int v = q.front ();
        q.pop ();
        d[v] = 1;
        gg.push_back (v);
        for (int to : g[v]) {
            if (to == w) return 1;
            if (!d[to])
                q.push (to);
        }
    }
    return 0;
}

int main()
{
    ios_base::sync_with_stdio (0);
    cin.tie (0);
    cout.tie (0);
    int n, m;
    cin >> n >> m;
    fill (d, d + n, 0);
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        g[u - 1].push_back (v - 1);
    }
    vector < int > ans ;
    int v = 0;
    for (int j = 0; j < n; ++j) {
        if (v == -1) {
            cout << "NO\n";
            return 0;
        }
        d[v] = 1;
        ans.push_back (v + 1);
        int nxt = -1;
        for (int i = 0; i < g[v].size(); ++i) {
            if (d[g[v][i]] == 0) {
                if (check (g[v][i], nxt))
                    nxt = g[v][i];
                for (int k : gg) d[k] = 0;
                gg.clear ();
            }
        }
        if (j == n - 1) {
            int ok = 0;
            for (int to : g[v]) {
                if (to == 0)
                    ok = 1;
            }
            if (!ok) {
                cout << "NO\n";
                return 0;
            }
        }
        v = nxt;
    }
    cout << "YES\n";
    ans.push_back (1);
    for (int i : ans) cout << i << " ";
    cout << "\n";
    return 0;
}


/*
9 12
1 9
9 3
3 4
4 5
5 6
6 2
2 7
7 8
8 1
1 7
1 2
1 3
*/
