#include <bits/stdc++.h>

using namespace std;

int n;
vector <vector <int>> m; 
vector <bool> u;
stack <int> s;

bool dfs (int k) {
    bool b;
    for (int i = 0; i < m[k].size(); i++) {
        if (s.size() == n) {
            if (m[k][i] == 0) {
                s.push(0);
                return true;
            }
        }
        if (u[m[k][i]] == false) {
            s.push(m[k][i]);
            u[m[k][i]] = true;
            b = dfs(m[k][i]);
            if (b == true) {return true;}
            s.pop();
            u[m[k][i]] = false;
        }
    }
    return false;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

	int k, a, b;
    bool B;
    cin >> n >> k;
    m.resize(n);
    for (int i = 0; i < k; i++) {
        cin >> a >> b;
        m[a - 1].push_back(b - 1);
    }
    u.resize(n);
    for (int i = 0; i < n; i++) {
        u[i] = false;
    }
    u[0] = true;
    s.push(0);
    B = dfs(0);
    if (B == false) {
        cout << "NO";
        return 0;
    }
    cout << "YES" << "\n";
    vector <int> ans;
    while (!s.empty()) {
        ans.push_back(s.top());
        s.pop();
    }
    for (int i = ans.size() - 1; i > -1; i--) {
        cout << ans[i] + 1 << " ";
    }
}
