#include <bits/stdc++.h>
using namespace std;

vector <vector <bool>> v;
vector <int> ch;
vector <int> ans;
vector <pair<bool, bool>> p;

void asdasd(vector <int> &ans, int asd) {
    ch[asd] = 1;
    ans.push_back(asd);
    for (int i = 0; i < v[asd].size(); i++)
        if (v[asd][i]) {
            if (ch[i]) {
                break;
            }
            asdasd(ans, i);
        }
    ch[asd] = 2;
}

int main() {
    int n, m, a, b;
    cin >> n >> m;
    v.resize(n);
    ch.resize(n);
    p.resize(n);
    for (int i = 0; i < n; i++) {
        p[i] = {false, false};
        v[i].resize(n);
        for (int j = 0; j < n; j++)
            v[i][j] = false;
        ch[i] = 0;
    }
    while (cin >> a >> b) {
        v[a - 1][b - 1] = true;
        p[a-1].first = true;
        p[b-1].second = true;
    }
    bool anananswer = true;
    for (auto i : p) {
        if (!i.first or !i.second) {
            anananswer = false;
            break;
        }
    }
    if (anananswer) {
        asdasd(ans, 0); 
        bool iscycle = false;
        for (auto i : ch)
            if (i == 1) {
                iscycle = true;
                break;
            }
        if (iscycle) {
            cout << "YES\n";
            for (auto i : ans)
                cout << i + 1 << " ";
            cout << 1;
        } else
            cout << "NO\n";
    }
    else
        cout << "NO";
        
}
