#include <bits/stdc++.h>
/*
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_cxx;
using namespace __gnu_pbds;
*/

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,tune=native")

#define fast ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);

#define CR const&

#define FORI(i, a, b) for(int i = a, max##i = b; i < max##i; ++i)
#define FOR(i, n) FORI(i, 0, n)
#define RFORI(i, a, b) for(int i = a, min##i = b; i >= min##i; --i)
#define RFOR(i, n) RFORI(i, n, 0)
#define FORA(i, a) for(auto i : a)
#define FORAR(i, a) for(auto& i : a)
#define FORACR(i, a) for(auto CR i : a)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define Count(q) while(q--)

#define OK cerr << "OK" << endl;

#define pb push_back


using namespace std;

template<class T>
using V = vector<T>;
template<class T>
using VV = V<V<T>>;

using ld = long double;
using ll = long long;
using PLL = pair<ll, ll>;
using PII = pair<int, int>;
using VI = V<int>;
using VLL = V<ll>;
using VVI = VV<int>;
using VVLL = VV<ll>;
using Gr = VVI;
using MLL = map<ll, ll>;

template<class T>
constexpr T sqr(T x)
{
    return x * x;
}

template<class T, class U = T>
void cmin(T& a, U const& b)
{
    if(b < a)
        a = b;
}

template<class T, class U = T>
void cmax(T& a, U const& b)
{
    if(a < b)
        a = b;
}

ll get_time()
{
    using namespace chrono;
    return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
}
mt19937 rng(get_time());

bool DFS(int u, VI& path, VI& was, Gr CR G, VI CR go, VI CR dist, int d)
{
    int n = was.size();
    if(d == n)
        return true;

    if(was[u])
        return false;

    was[u] = true;
    path.pb(u);
    if(go[u] != u)
    {
        if(DFS(go[u], path, was, G, go, dist, d + dist[u]))
            return true;

        was[u] = false;
        path.pop_back();
        return false;
    }

    FORA(v, G[u])
        if(DFS(v, path, was, G, go, dist, d + 1))
            return true;

    was[u] = false;
    path.pop_back();
    return false;
}

int main()
{
    fast

    int n, m;
    cin >> n >> m;

    Gr G(n);
    Count(m)
    {
        int u, v;
        cin >> u >> v;

        G[--u].pb(--v);
    }

    VI go(n, -1), dist(n);
    function<PII(int)> get_go = [&](int u)
    {
        if(go[u] != -1)
            return PII{go[u], dist[u]};

        if(G[u].size() != 1)
        {
            go[u] = u;
            dist[u] = 0;
            return PII{go[u], dist[u]};
        }

        go[u] = -2;
        dist[u] = 0;
        auto p = get_go(G[u][0]);
        go[u] = p.first;
        dist[u] = p.second + 1;

        return PII{go[u], dist[u]};
    };

    VI was(n);
    VI path_res;
    function<void(int)> get_path = [&](int u)
    {
        path_res.pb(u);
        if(G[u].size() != 1)
            return;
        if(was[u])
            return;

        was[u] = 1;
        get_path(G[u][0]);
        was[u] = 0;
    };

    FOR(i, n)
    {
        if(get_go(i).first == -2)
        {
            path_res.clear();
            get_path(i);
            if(path_res.size() == n + 1)
            {
                cout << "YES\n";
                FORACR(j, path_res)
                    cout << j + 1 << " ";
                return 0;
            } else
            {
                cout << "NO\n";
                return 0;
            }
        }
    }

    VI path;
    int v = 0;
    if(go[0] != 0)
    {
        path.pb(0);
        v = go[0];
    }

    if(!DFS(v, path, was, G, go, dist, 0))
    {
        cout << "NO\n";
        return 0;
    }

    fill(ALL(was), false);

    /*for(int i = 0; i < n; ++i)
        cerr << i << " -> " << go[i] << " " << dist[i] << "\n";
    cerr << "path: ";
    for(auto i : path)
        cerr << i << " ";
    cerr << "\n";
    return 0;*/

    cout << "YES\n";
    for(int i = 0; i + 1 < path.size(); ++i)
    {
        path_res.clear();
        get_path(path[i]);

        for(auto j : path_res)
            cout << j + 1 << " ";
    }

    path_res.clear();
    get_path(path.back());

    for(auto j : path_res)
    {
        cout << j + 1 << " ";
        if(j == 0)
            break;
    }
}
