#include <iostream>
#include <bits/stdc++.h>

// #define int long long
#define endl '\n'
//#define inf 2000000000000000000
#define random (rand()^(rand()<<15))

using namespace std;
//mt19937 rnd(time(nullptr));
//constexpr int mod=1000000007;
//constexpr int MOD=998244353;
bitset<100010>used;
vector<vector<int>>g;
vector<int>res;
int n;
int t;
bool dfs(int v,int gl=0)
{
    // cout<<t<<" "<<clock()<<" "<<clock()-t<<endl;
    if(clock()-t>=909000)
    {
        cout<<"NO"<<endl;
        exit(0);
    }
    used[v]=1;
    for(int&i:g[v])
    {
        if(!i&&gl+1==n)
        {
            res.push_back(v+1);
            return 1;
        }
        if(dfs(i,gl+1))
        {
            res.push_back(v+1);
            return 1;
        }
    }
    used[v]=0;
    return 0;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    t=clock();
    int m;
    cin>>n>>m;
    g.resize(n);
    res.reserve(n);
    for(int i=0;i<m;i++)
    {
        int x,y;
        cin>>x>>y;
        x--;y--;
        g[x].push_back(y);
    }
    if(!dfs(0,0))
    {
        cout<<"NO"<<endl;
        return 0;
    }
    cout<<"YES"<<endl;
    reverse(res.begin(),res.end());
    for(int&i:res)
    {
        cout<<i<<" ";
    }
    cout<<res[0]<<endl;
}
