#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx")
#pragma startup dfs 
#pragma exit dfs 
#include <iostream>
#include <map>
#include <vector>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <climits>
#include <ctime>
#include <iomanip>
#include <string>
using namespace std;

const int N = 100005;
int us[N];
int uss[N];
int n;
deque<int> g[N];
int gg[N];
vector<int> p;

void dfs(const int v)
{
    p.push_back(v);
    us[v] = 1;
    for(auto to: g[v])
    {
        if(us[to] == 0 && (gg[to] == v || gg[to] == 0) )
        {
            dfs(to);
        }
        else
        if(to == 1 && p.size() == n)
        {
            cout<<"YES\n";
            cout<<1;
            for(int t = n - 1; t>=0; t--)
            {
                cout<<res[t]<<' ';
            }
            exit(0);
        }
    }
    us[v] = 0;
    p.pop_back();
}

main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int m;
    cin>>n>>m;
    for(int i = 0; i < m; i++)
    {
        int a, b;
        cin>>a>>b;
        swap(a,b);
        g[a].push_front(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;
        }
        us[i]=0;
    }
    dfs(1);
    cout<<"NO";
    return 0;
}