#include <bits/stdc++.h>

using namespace std;

long long n,a[100009],res,last1,last2,h,pr[100009],q,L,R,v1,v2,used[100009],k,m,ans[100009],f,y,p;
set<long long> j,r;
vector<long long> A[100009];
void dfs(long long v){
    used[v]=1;
    k++;
    ans[k]=v;
    if(k>=n){
        for(auto to:A[v]) if(to==1) y=1;
         if(y==1 && k==n && f==0) {
                cout<<"YES"<<"\n";
               for(int i=1;i<=n;i++ ) cout<<ans[i]<<" ";
               cout<<1<<"\n";
                f=1;
        }

    }
    else{
   for(auto to:A[v]){
     if(used[to]==0) dfs(to);
   }
    }
   k--;
   used[v]=0;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        cin>>v1>>v2;
        A[v1].push_back(v2);
        j.insert(v1);
        r.insert(v2);
    }
    for(int i=1;i<=n;i++) if(j.count(i)+r.count(i)<2) p=1;
    if(p==1 || min(m,n)>=90020) cout<<"NO"<<"\n";
    else{
    dfs(1);
    if(f==0) cout<<"NO"<<"\n";
    }
    return 0;
}
