#include <bits/stdc++.h>

using namespace std;

#define DIM 409

int n,m,v1,v2;

vector<int> V[100007], res;
bool ok=false;
int used[100007];
void dfs(int v){
    used[v]=1;
    res.push_back(v);
    for(auto x:V[v]){
        if(used[x]==0) dfs(x);
    }
}

int main(){

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

    dfs(1);
    res.push_back(1);
    if(res.size()==n+1) ok=1;
    if(ok==1) {
        cout << "YES" << endl;
        for(auto x:res) cout << x << " ";
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

