#include <iostream>

using namespace std;

const int DIM = 10007;

int n, m, v1, v2;

int graph[DIM][DIM];

int path[DIM];

int findPath(int num) {

    if (num == n) {
        if (graph[path[num]][1] != 0) {
            path[num + 1] = 1;
            return 1;
        }
        else return 0;
    }

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

        if (graph[path[num]][i] == 1) {
            path[num + 1] = i;
            if (findPath(num + 1) == 1) return 1;
            path[num + 1] = 0;
        }
    }

    return 0;

}

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

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

    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;
}
