#include <bits/stdc++.h>

using namespace std;
vector<long long> g[100005];
bool used[100005];
bool f= false;
long long cnt = 0;
vector<long long> ans;
vector<long long> c;
long long n,m;
void dfs(long long v)
{
    used[v] = true;
    cnt ++;
    c.push_back(v);
    for(int i = 0; i < g[v].size(); i++){
        long long to = g[v][i];
        if(cnt == n && to == 0 && f == false)
        {
            for(int j = 0; j<c.size(); j++)
            {
                ans.push_back(c[j]);
            }
            f = true;
        } else if(used[to ] == false) dfs(to);
    }
    c.erase(c.end()-1);
    used[v] = false;
    cnt --;

}
int main()
{

   cin>>n>>m;
   long long a ,b;
   for(int i = 0; i < m; i ++)
   {
       cin>>a>>b;
       a--;
       b--;
       g[a].push_back(b);
   }
   dfs(0);
   if(f == false)
    cout<<"NO\n";
   else {
    cout<<"YES\n";
    for(int i = 0; i < n; i ++)
        cout<<ans[i] + 1 <<' ';
    cout<<1;
   }
}
