#include <bits/stdc++.h>
#define ll long long 
#define ull unsigned ll
#define dbl double

using namespace std;

const int N = 1e5 + 10;
vector <int> g[N];
vector <int> revg[N];
int n;
bool globalcheck = false;

int cycle[N], pr[N];
bool used[N];

bool operate(int v, vector <int> rec)
{
    if (globalcheck)
    {
        v = 0;
        rec.clear();
        return true;
    }

    /*cout << v << endl;
    for (int i = 0; i < rec.size(); ++i)
        cout << rec[i] << " ";
    cout << endl;*/

    used[v] = true;
    //order.push_back(v);
    if (cycle[v] != 0 && !used[cycle[v]])
        operate(cycle[v], rec);

    if (g[v].size() == 1)
    {
        int to = g[v][0];
        bool flag = true;
        for (int i = 1; i <= n; ++i)
            if (!used[i])
            {
                flag = false;
                break;
            }
        if (flag)
        {
            if (to == 1)
            cycle[v] = 1;
            if (!globalcheck)
            {
                cout << "YES" << endl;
                int cur = 1;
                while (cycle[cur] != 1)
                {
                    cout << cur << " ";
                    cur = cycle[cur];
                }
                cout << cur << " " << 1;
                globalcheck = true;
                return true;
            }
        }

        if (!used[to])
        {
            cycle[v] = to;
            pr[to] = v;
            operate(to, rec);
        }
    }
    if (globalcheck)
    {
        v = 0;
        rec.clear();
        return true;
    }
    
    for (size_t i = 0; i < g[v].size(); ++i)
    {
        int to = g[v][i];
        if (!used[to])
        {
            cycle[v] = to;
            pr[to] = v;
            rec.push_back(v);
            operate(to, rec);
        }
    }
    
    if (globalcheck)
    {
        v = 0;
        rec.clear();
        return true;
    }

    bool flag = true;
    for (int i = 1; i <= n; ++i)
        if (!used[i])
        {
            flag = false;
            break;
        }
    
    if (flag)
    {
        for (size_t i = 0; i < g[v].size(); ++i)
            if (g[v][i] == 1)
            {
                cycle[v] = 1;
                if (!globalcheck)
                {
                    cout << "YES" << endl;
                    int cur = 1;
                    while (cycle[cur] != 1)
                    {
                        cout << cur << " ";
                        cur = cycle[cur];
                    }
                    cout << cur << " " << 1;
                    globalcheck = true;
                    return true;
                }
            }
        return true;
    }

    if (globalcheck)
    {
        v = 0;
        rec.clear();
        return true;
    }

    while (rec.size() != 0)
    {
        if (rec.size() == 0)
            return false;
        int change = rec[rec.size() - 1];
        int cur = v;
        while (cur != change)
        {
            used[cur] = false;
            cur = pr[cur];
        }
        bool f = false;
        for (size_t i = 0; i < g[change].size(); ++i)
        {
            int to = g[change][i];
            if (to == cycle[change])
                f = true;
            if (f && to != cycle[change])
            {
                rec[rec.size() - 1] = to;
                operate(to, rec);
            }
        }
        rec.pop_back();
    }
    if (globalcheck)
    {
        v = 0;
        rec.clear();
        return true;
    }
    return false;
}

int main() {
    /*ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);*/

	int m;
    cin >> n >> m;
    for (int mm = 0; mm < m; ++mm)
    {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
    }

    if (n < 5)
    {
        int start = 1;
        priority_queue < pair <int, vector <int> > > q;
        vector <int> s;
        s.push_back(start);
        q.push({s.size(), s});
        s.clear();

        while (!q.empty())
        {
            pair <int, vector <int> > cur = q.top();
            q.pop();

            s = cur.second;
            int v = s[s.size() - 1];
            if (s.size() == n)
            {
                for (int i = 0; i < g[v].size(); ++i)
                    if (g[v][i] == start)
                    {
                        cout << "YES" << endl;
                        for (int i = 0; i < s.size(); ++i)
                            cout << s[i] << " ";
                        cout << start;
                        return 0;                     
                    }
            }
            else
            {
                int v = s[s.size() - 1];
                bool used[N] = {};
                for (int i = 0; i < s.size(); ++i)
                    used[s[i]] = true;

                for (int i = 0; i < g[v].size(); ++i)
                    if (!used[g[v][i]])
                    {
                        vector <int> next = s;
                        next.push_back(g[v][i]);
                        q.push({next.size(), next});
                    }
            }
        }
        cout << "NO";
        return 0;
    }

    for (int i = 1; i <= n; ++i)
        for (int j = 0; j < g[i].size(); ++j)
            revg[g[i][j]].push_back(i);

    for (int i = 1; i <= n; ++i)
        if (revg[i].size() == 1)
        {
            if (cycle[revg[i][0]] != 0)
            {
                cout << "NO";
                return 0;
            }
            cycle[revg[i][0]] = i;
            pr[i] = revg[i][0];
        }

    int cur = 1;
    int qop = 0;
    for (int i = 1; i <= n; ++i)
        cout << cycle[i] << " ";
    cout << endl;

    while (cycle[cur] != 0)
    {
        ++qop;
        used[cur] = true;
        cur = cycle[cur];
    }
    vector <int> v;
    metka:
    if (operate(cur, v) || globalcheck)
        return 0;
    cout << "NO";
}
