#include<bits/stdc++.h>
#include<stdlib.h>
#define pb push_back
#define ff first
#define ss second
#define int long long
#define let long long
//#define mp make_pair
#define cin_arr(arr,n) for (int i=0; i<n;i++) cin>>arr[i];
#define cout_arr(arr,n) for (int i=0; i<n;i++) cout<<arr[i]<<" ";
#define cout_set(st) for (auto i:st) cout<<i<<" ";
#define endl '\n'
using namespace std;
int n,m;
vector<int>v[100005],path;
vector<pair<int,int> >v1[100005];
int color[100005],start[100005];
bool f=false;
void dfs(int x){
    color[x]++;
    if (x==0 && f==true) return;
    f=true;
    for (int i=0; i<v[x].size();i++) {
        dfs(v[x][i]);
    }
}

void dfs1(int x) {
    path.pb(x+1);
    if (x==0 && f) return;
    f=true;
    start[x]++;
    dfs1(v1[x][start[x]-1].ss);
}

int32_t main()
{
    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

    cin>>n>>m;
    for (int i=0; i<m;i++) {
        int x,y;
        cin>>x>>y;
        x--;y--;
        v[x].pb(y);
        //v[y].pb(x);
    }
    dfs(0);
    f=false;
    for (int i=0; i<n;i++) {
        for (int j=0; j<v[i].size();j++) {
            v1[i].pb({color[v[i][j]],v[i][j]});
        }
        sort(v1[i].begin(),v1[i].end());
    }
    dfs1(0);
    if (path.size()!=n+1) {
        cout<<"NO";
    }
    else {
        cout<<"YES\n";
        cout_arr(path,path.size());
    }
}

