#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int DIM = 100007;

int n, m, v1, v2;

vector<int> graph[DIM];

int path[DIM];

int findPath(int num) {

    if (num == n) {
        if (count(graph[path[num]].begin(), graph[path[num]].end(), 1)) {
            path[num + 1] = 1;
            return 1;
        }
        else return 0;
    }

    for (int i = 1; i <= n; i++) {
        if (i == path[num]) continue;

        if (count(graph[path[num]].begin(), graph[path[num]].end(), i)) {
            path[num + 1] = i;
            if (findPath(num + 1) == 1) return 1;
        }
    }

    return 0;

}

int main() {
    cin >> n >> m;

    for (int i = 1; i <= m; i++) {
        cin >> v1 >> v2;
        graph[v1].push_back(v2);
    }

    path[1] = 1;
    if (findPath(1) == 1) {
        cout << "YES" << endl;
        for (int i = 1; i <= n + 1; i++) cout << path[i] << " ";
    } else {
        cout << "NO" << endl;
    }

    return 0;
}
