#include <iostream>
#include <vector>

using namespace std;

int n, m;
vector<pair<int, int> > g[101010];
vector<pair<int, int> > gr[101010];
vector<int> stk;
int Imm[101010];
int SzOfImm[101010];
bool MST[101010];
int IDSave[101010];

int color[101010];
int SZ = 0;
void dfs(int v) {
    if (color[v] == 1) {
        if (SZ == n && v == 1) {
            cout << "YES\n";
//            for (auto i : stk)cout << i << " ";cout << endl;
            int V = stk[0];
            vector<int> ANSWER; ANSWER.push_back(V);
            int p = 1;
//            for (int v = 1; v <= n; v++) {
//                cout << v << " " << g[v].size() << endl;
//                for (auto [to, id] : g[v])
//                    cout << to << " " << id << " ; ";
//                cout << endl;
//            }
            while (true) {
//                cout << V << "  " << p << "  " << stk[p] << endl;
                if (p < stk.size()) {
                    bool fnd = false;
                    for (auto [to, id] : g[V]) {
//                        cout << to << " " << id << " ??? " << endl;
                        if (to == stk[p]) {
                            ANSWER.push_back(to);
                            V = to;
//                            cout << "P++" << endl;
                            p++;
                            fnd = true;
                            break;
                        }
                    }
                    if (fnd)continue;
                    V = g[V][0].first;
                    ANSWER.push_back(V);
                    continue;
                } else {
                    bool fnd = false;
                    for (auto [to, id] : g[V]) {
                        if (to == 1) {
                            ANSWER.push_back(to);
                            fnd = true;
                            break;
                        }
                    }
                    if (fnd)break;
                    V = g[V][0].first;
                    ANSWER.push_back(V);
                    continue;
                }
            }
            for (auto i : ANSWER)cout << i << " ";
            exit(0);
        }
        return;
    }
    if (Imm[v] != 0 && Imm[v] != v) {
        stk.push_back(v);
        color[v] = 1;
        SZ += (SzOfImm[v] - 1);
        dfs(Imm[v]);
        SZ -= (SzOfImm[v] - 1);
        stk.pop_back();
        color[v] = 0;
        return;
    }
//    cout << v << " ---  " << Imm[v] << " " << SzOfImm[v] << endl;
    stk.push_back(v);SZ++;
    color[v] = 1;
    for (auto [to, id] : g[v]) {
        if (color[to] == 1) {
            if (SZ != n)continue;
            if (to != 1)continue;
            dfs(to);
        }
        if (!MST[to]) {
            dfs(to);
        } else {
            if (id == IDSave[to])
                dfs(to);
        }
    }
    color[v] = 0;
    stk.pop_back();SZ--;
}

bool used[101010];
int END;
void ToEnd(int v) {
    if (g[v].size() != 1 || gr[v].size() != 1) {
        return;
    }
    if (used[v]) {
        if (v != END)return;
    }
    END = v;
    return ToEnd(g[v][0].first);
}
void calc(int v, int depth) {
    if (used[v]) {
         return;
    }
    used[v] = true;
    Imm[v] = END;
    SzOfImm[v] = depth;
    if (gr[v].size() != 1)return;
    return calc(gr[v][0].first, depth + 1);
}

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= m; i++) {
        int A, B;
        cin >> A >> B;
        g[A].push_back({B, i});
        gr[B].push_back({A, i});
    }
    for (int i = 1; i <= n; i++) {
        if (g[i].size() != 1)continue;
        MST[g[i][0].first] = true;
        IDSave[g[i][0].first] = g[i][0].second;

        if (used[i])continue;
        used[i] = true;
        END = i;
//        ToEnd(i);
////        cout << i << "   " << END << " <<< " << endl;
//        calc(END, 1);
    }
    dfs(1);
    cout << "NO";
    return 0;
}
/**
15 15
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 1



5 8
1 2
1 3
1 5
2 3
3 4
4 1
5 3
5 2



5 7
1 2
1 3
1 5
2 3
3 4
4 1
5 3
*/
