#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const int N = 1e5 + 30;
vector < int > g[N];
int d[N], nxt[N], n;
vector < int > num;

void rec (int i) {
    if (i == num.size()) {
        int cnt = 1, cur = nxt[0];
        while (cur != 0 && cnt <= n + 2) {
            ++cnt;
            cur = nxt[cur];
        }
        if (cnt == n) {
            cout << "YES\n1 ";
            cur = nxt[0];
            while (cur != 0) {
                cout << cur + 1 << " ";
                cur = nxt[cur];
            }
            cout << "1\n";
            exit (0);
        }
        return ;
    }
    for (int j = 0; j < g[num[i]].size(); ++j) {
        nxt[num[i]] = g[num[i]][j];
        rec (i + 1);
    }
    return ;
}

void dfs (int v) {
    d[v] = 1;
    for (int to : g[v])
        if (!d[to])
            dfs (to);
    return ;
}

int main()
{
    int 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);
    }
    dfs (0);
    for (int i = 0; i < n; ++i) {
        if (!d[i]) {
            cout << "NO\n";
            return 0;
        }
    }
    for (int i = 0; i < n; ++i) {
        if (g[i].size () == 1) nxt[i] = g[i][0];
        else num.push_back (i);
    }
    rec (0);
    cout << "NO\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
*/
