#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define endl '\n'
const int N = 2e5+7;
const int K = 21;
vector<int> G[N];
int P[N][2],indeg[N],outdeg[N],cmp[N],tail[N];
int F(int x,bool col){
    if (P[x][col]==-1){
        cout<<"NO\n";
        exit(0);
    }
    if (x==P[x][col]){
        return x;
    }
    int vl = P[x][col];
    P[x][col] = -1;
    P[x][col] = F(vl,col);
    return P[x][col];
}
bool vis[N];
const int masksz = 1<<K;
int dp[masksz][K];
bool A[K][K];
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 if (G[i].size()==0){
            cout<<"NO\n";
            return;
        }
        else{
            cnt += 1;
        }
    }
    bool FL = 1;
    {
        for(int i = 1;i<=n;i+=1){
            indeg[i] = outdeg[i] = 0;
        }
        for(int i = 1;i<=n;i+=1){
            indeg[i] = G[i].size();
            for(int to:G[i]){
                outdeg[to] += 1;
            }
        }
        for(int i = 1;i<=n;i+=1){
            if (indeg[i]!=outdeg[i] || indeg[i]!=1){
                FL = 0;
            }
        }
        if (FL){
            int cnt = 1;
            int cur = 1;
            do{
                cur = P[cur][0];
                cnt += 1;
            }while(cur!=1);
            if (cnt!=n+1){
                FL = 0;
            }
        }
    }
    if (n==1){
        FL = 1;
    }
    if (!FL) {
        int ptr = 0;
        for (int i = 1; i <= n; i += 1) {
            if (!cmp[F(i, 0)]) {
                cmp[F(i, 0)] = ++ptr;
                tail[ptr] = F(i, 1);
            }
            cmp[i] = cmp[F(i, 0)];
        }
        for (int c = 1; c <= ptr; c += 1) {
            for (int to: G[tail[c]]) {
                if (to == F(to, 0)) {
                    A[c][cmp[to]] = 1;
                }
            }
        }
        dp[1][0] = 1;
        int sz = 1 << ptr;
        for (int mask = 2; mask < sz; mask += 1) {
            if (mask % 2 == 0) {
                continue;
            }
            vector<int> bits;
            for (int bit = 0; bit < ptr; bit += 1) {
                if ((mask >> bit) % 2) {
                    bits.push_back(bit);
                }
            }
            for (int last: bits) {
                int submask = mask ^ (1 << last);
                for (int prev: bits) {
                    if (prev == last) {
                        continue;
                    }
                    if (dp[submask][prev] && A[last + 1][prev + 1]) {
                        dp[mask][last] = 1;
                        break;
                    }
                }
            }
        }
        if (ptr != 1) {
            int last = -1;
            for (int i = 0; i < ptr; i += 1) {
                if ((1 == i + 1 || A[1][i + 1]) && dp[sz - 1][i]) {
                    last = i;
                    break;
                }
            }
            if (last == -1) {
                cout << "NO\n";
                return;
            }
            if (last != 0) {
                G[tail[1]].clear();
                G[tail[1]].push_back(F(tail[last + 1], 0));
            }
            int mask = sz - 1;
            while (last != 0) {
                int prev = -1;
                for (int i = 0; i < ptr; i += 1) {
                    if (dp[mask ^ (1 << last)][i] && A[last + 1][i + 1]) {
                        prev = i;
                        break;
                    }
                }
                G[tail[last + 1]].clear();
                G[tail[last + 1]].push_back(F(tail[prev + 1], 0));
                mask ^= 1 << last;
                last = prev;
            }
        } else {
            for (int to: G[tail[1]]) {
                if (to == F(to, 0)) {
                    G[tail[1]].clear();
                    G[tail[1]].push_back(to);
                    break;
                }
            }
            if (G[tail[1]].size() > 1) {
                cout << "NO\n";
                return;
            }
        }
    }
    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;


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