#include <bits/stdc++.h>
using namespace std;
const int N=100100;
int v, u, n, m, flag = 1, vis[N], start, num;
vector<int> g[N];

void dfs(int v, int cnt)
{
    //cout << v << " ";
    vis[v] = cnt;
    for (int i=0; i<g[v].size(); i++)
    {
        int u= g[v][i];
        if (vis[u] < cnt)
        {
            if (v == start) num++;
        if (num > 1) 
        {
            flag = 0;
            return;
        }
            dfs(u, cnt);
        }
    }
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

	int n, m;
    cin >> n >> m;
    for (int i=1; i<=m; i++)
    {
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    for (int i=1; i<=n; i++) if (g[i].size() < 2) 
    {
        cout<<"NO"<<"\n";
        return 0;
    }
    start = 1;
    num = 0;
    dfs(1, 1);
    //cout << endl;
    for (int i=1; i<=n; i++)
    {
        if (vis[i] == 0) 
        {
            cout<<"NO"<<"\n";
            return 0;
        }
    }
    if (n == m)
    {
        cout << "YES" << "\n";
        int pr = 1, pot = g[1][1];
        cout << 1 << " ";
        while (pot != 1)
        {
            cout << pot << " ";
            if (g[pot][1] != pr)
            {
                pr = pot;
                pot = g[pot][1];
            }
            else 
            {
                pr = pot;
                pot = g[pot][2];
            }
        }
        cout << 1 << "\n";
        return 0;
    }
    cout << "NO" << "\n";
    /*for (int i=1; i<=n; i++)
    {
        if (g[i].size() >= 3)
        {
            if ( i != 1)
            {
                start = i;
                num =0;
                dfs(i, i);
                if (flag == 0)
                {
                    cout<< "NO"<<"\n";
                return 0;
                }
            }
            int cnt = 0;
            for (int j=0; j<g[i].size(); j++)
            {
                cnt += (g[g[i][j]].size() == 2);
            }
            if (cnt > 2) 
            {
                cout<<"NO"<<"\n";
                return 0;
            }
        }
    }*/
}
