#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define endl '\n'
const int N = 2e5+7;
vector<int> G[N];
int P[N][2],indeg[N],outdeg[N];
int F(int x,bool col){
    if (x==P[x][col]){
        return x;
    }
    return P[x][col] = F(P[x][col],col);
}
bool vis[N];
bool dfs(int v,int need){
    if (need==1){
        v = F(v,1);
        for(int to:G[v]){
            if (to==F(1,0)){
                G[v].clear();
                G[v].push_back(F(1,0));
                return 1;
            }
        }
        return 0;
    }
    vis[F(v,0)] = 1;
    v = F(v,1);
    for(int to:G[v]){
        if (!vis[F(to,0)] && to==F(to,0)){
            bool ret = dfs(to,need-1);
            if (ret==1){
                int el = to;
                G[v].clear();
                G[v].push_back(el);
                return 1;
            }
        }
    }
    vis[F(v,0)] = 0;
    return 0;
}
void solve(){
    int n,m;
    cin>>n>>m;
    for(int i = 1;i<=m;i+=1){
        int a,b;
        cin>>a>>b;
        outdeg[a] += 1;
        indeg[b] += 1;
        G[a].push_back(b);
    }
    for(int i = 1;i<=n;i+=1){
        P[i][0] = P[i][1] = i;
    }
    int cnt = 0;
    for(int i = 1;i<=n;i+=1){
        if (G[i].size()>1){
            int ct = 0;
            for(int to:G[i]){
                if (indeg[to]==1){
                    ct += 1;
                }
            }
            if (ct>1){
                cout<<"NO\n";
                return;
            }
            for(int to:G[i]){
                if (indeg[to]==1){
                    G[i].clear();
                    G[i].push_back(to);
                }
            }
        }
        if (G[i].size()==1){
            if (P[G[i][0]][0]!=G[i][0]) {
                cout << "NO\n";
                return;
            }
            P[G[i][0]][0] = i;
            P[i][1] = G[i][0];
        }
        else{
            cnt += 1;
        }

    }
    if (cnt>20){
        n/=0;
    }
    if (dfs(F(1,0),cnt)){
        cout<<"YES\n";
        int cur = 1;
        cout<<cur<<' ';
        cur = G[cur][0];
        while(1){
            cout<<cur<<' ';
            if (cur==1){
                break;
            }
            cur = G[cur][0];
        }
        cout<<endl;
    }
    else{
        cout<<"NO\n";
    }


}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
