#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<int> > g;
vector<int> used;
vector<int> ans;
void dfs(int v){
    if(ans[1]){
        return;
    }
    for(int i = 0; i < g[v].size(); i++){
        int to = g[v][i];
        if(to == 0 && used[v] == n-1){
            for(int j = 0; j < n; j++){
                ans[used[j]]=j;
            }
            cout << "YES" << endl;
            for(int i = 0; i < n; i++){
                cout << ans[i]+1 << ' ';
            }
            cout << 1;
            return;
        }else if(to == 0){
            return;
        }
        if(!used[to]){
            used[to] = used[v]+1;
            dfs(to);
            used[to] = 0;
        }
    }
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    g.resize(n);
    used.resize(n);
    ans.resize(n);
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        a--;b--;
        g[a].push_back(b);
    }
    used[0] = 0;
    dfs(0);
    if(!ans[1]){
        cout << "NO";
    }
}
