#include <bits/stdc++.h>
using namespace std;

const int N = 100090;
int us[N];
int uss[N];
int n;
vector<int> res;
vector<int> g[N];
int gg[N];

void dfs(int v, vector<int>& p)
{
    p.push_back(v);
    us[v] = 1;
    for(auto to: g[v])
    {
        if(us[to] == 0 && (gg[to] == 0 || gg[to] == v))
        {
            dfs(to, p);
        }
        else
        if(to == 1 && p.size() == n)
        {
            res = p;
            return;
        }
    }
    //us[v] = 0;
    p.pop_back();
}

main()
{
    int m;
    cin>>n>>m;
    for(int i = 0; i < m; i++)
    {
        int a, b;
        cin>>a>>b;
        g[a].push_back(b);
        if(us[b] == 0)
        {
            us[b] = a;
        }
        else us[b] = -1;

        if(uss[a] == 0)
        {
            uss[a] = b;
        }
        else uss[a] = -1;
    }
    for(int i = 1; i <= n; i++)
    {
        if(us[i] == 0 || uss[i] == 0)
        {
            cout<<"NO";
            return 0;
        }
        if(us[i] != -1)
        {
            g[us[i]] = {i};
        }
        if(uss[i] != -1)
        {
            gg[uss[i]] = i;
        }
    }
    fill(us, us + n + 1, 0);
    vector<int> k;
    dfs(1, k);
    int w = res.size();
    if(w != n)
    {
        cout<<"NO";
        return 0;
    }
    cout<<"YES\n";
    for(auto t:res)
    {
        cout<<t<<' ';
    }
    cout<<1;

}