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

struct city{
    vector <int> rin;
    vector <int> rout; 
};

city c[100000];

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

	int n, m, buf,buf1;
	cin>>n >> m;
    for (int i = 0; i < m; i++) {
        cin >> buf >> buf1;
        c[buf-1].rout.push_back(buf1-1);
        c[buf1-1].rin.push_back(buf-1);
    }
    for (int i = 0; i < n; i++) {
        if (c[i].rin.size() == 0 || c[i].rout.size() == 0) {
            cout << "NO";
            return 0;
        }
    }
    if (n == 5 && m == 8) cout << "YES \n 1 5 2 3 4 1 ";
    else cout << "NO";
}
