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

vector<int> a[100001];
bool b[100001] = {false};
vector<int> w;
int n;
int m;

bool g(int n) {
    int l = a[n].size();
    int k = w.size();
    vector<int> v = w;
    for (int i = 0; i < l; i++) {
        if (b[a[n][i]]) {
            continue;
        }
        if (a[n][i] == 1) {
            bool h = true;
            for (int j = 2; j <= n + 1; j++) {
                if (!b[j]) {
                    h = false;
                    break;
                }
            }
            if(h) {
                return true;
            }
            else {
                continue;
            }
        }
        b[a[n][i]] = true;
        w.push_back(a[n][i]);
        if (g(a[n][i])) {
            return true;
        }
        else {
            w = v;
            b[a[n][i]] = false;
        }
    }
    return false;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
	cin >> n >> m;
    int fr;
    int sc;
    for (int i = 0; i < m; i++) {
        cin >> fr >> sc;
        a[fr].push_back(sc);
    }
    if (g(1)) {
        cout << "YES" << "\n";
        cout << "1 ";
        for (int i = 0; i < n - 1; i++) {
            cout << w[i] << ' ';
        }
        cout << "1";
    }
    else {
        cout << "NO";
    }
}
