//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target ("avx,avx2,tune=native")
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#define int long long
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sqr(x) ((x)*(x))
#define PI 3.14159265358979323846
using namespace std;
using pii = pair <int, int>;
constexpr int maxn = 1e6 + 10;
constexpr int mod = 998244353;
constexpr long long inf = 1e18 + 10;
constexpr long double eps = 1e-15;
mt19937_64 rng (chrono::steady_clock::now ().time_since_epoch ().count ());

int n, m;
vector <int> graph [maxn];
int p [maxn];
bool used [maxn];
vector <int> q;
vector <int> K, Q;
int c [maxn];
vector <int> res;

inline void check () {
    res.clear ();
    int v = 0;
    res.pb (1);
    while (p[v] != 0) {
        res.pb ((v = p[v]) + 1);
    }
    res.pb (1);
    if ((int) res.size () < n + 1) return;
    cout << "YES\n";
    for (int i : res) cout << i << ' ';
    cout << '\n';
    exit (0);
}

inline void dfs (int v) {
    if (v == m) check ();
    for (int i : graph[q[v]]) if (!used[i]) {
        used[i] = true;
        p[q[v]] = i;
        dfs (v + 1);
        used[i] = false;
        p[q[v]] = -1;
    }
}

inline void solve () {
    int m, a, b;
    cin >> n >> m;
    while (m--) {
        cin >> a >> b, --a, --b;
        graph[a].push_back (b);
    }
    for (int i = 0; i < n; ++i) p[i] = -1;
    for (int i = 0; i < n; ++i) if ((int) graph[i].size () == 1) {
        p[i] = graph[i][0];
        if (used[graph[i][0]]) {
            cout << "NO\n";
            exit (0);
        }
        used[graph[i][0]] = true;
    } else q.pb (i);
    while (!q.empty ()) {
        Q = {};
        for (int i : q) {
            K = {};
            for (int j : graph[i]) if (!used[j]) K.pb (j);
            graph[i] = K;
            if ((int) graph[i].size () == 1) {
                p[i] = graph[i][0];
                if (used[graph[i][0]]) {
                    cout << "NO\n";
                    exit (0);
                }
                used[graph[i][0]] = true;
            } else  Q.pb (i);
        }
        if (q.size () == Q.size ()) break;
        q = Q;
    }
    m = (int) q.size ();
    dfs (0);
    cout << "NO\n";
}

signed main() {
    //freopen ("parallelepiped.in", "r", stdin);
    //freopen ("parallelepiped.out", "w", stdout);
    cin.tie(nullptr) -> sync_with_stdio(false);
    //cout << fixed << setprecision (12);
    int t = 1, g;
    //cin >> t;
    while (t--) solve ();
    return 0;
}