#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;
int color[100005],start[100005];
bool f=false;

bool cmp(int a,int b) {
    if (color[a]<color[b]) return true;
    return 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(v[x][start[x]-1]);
}

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++) {
        sort(v[i].begin(),v[i].end(),cmp);
    }
    dfs1(0);
    if (path.size()!=n+1) {
        cout<<"NO";
    }
    else {
        cout<<"YES\n";
        cout_arr(path,path.size());
    }
}

