#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],v1[100005],path;
int start[100005],color1[100005];
set<int>st;
bool f=false;

bool cmp(int a,int b) {
    if (color1[a]<color1[b]) return true;
    return false;
}

bool cmp1(int a,int b) {
    if (v1[a].size()<v1[b].size()) return true;
    return false;
}

void dfs1(int x) {
    path.pb(x+1);
    int sz=st.size();
    st.insert(x+1);
    if (sz==st.size()) return;
    if (x==0 && f) return;
    f=true;
    start[x]++;
    dfs1(v[x][start[x]-1]);
}

int color[100005];
void dfs(int x){
    if (color[x]==2) return;
    color[x]++;
    for (int i=0; i<v[x].size();i++) {
        dfs(v[x][i]);
    }
}
bool used[100005];
void make_color_dfs(int x,int p) {
    if (x!=0)
    color1[x]+=v[x].size()+color1[p];
    if (used[x]) return;
    used[x]=true;
    for (int i=0; i<v[x].size();i++) {
        make_color_dfs(v[x][i],x);
    }

}

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);
        v1[y].pb(x);
    }
    dfs(0);
    for (int i=0; i<n;i++) {
        if (color[i]!=2) return cout<<"NO",0;
    }
    color1[0]=1;
    for (int i=0; i<n;i++) {
        sort(v[i].begin(),v[i].end(),cmp1);
    }
    make_color_dfs(0,-1);
//    cout_arr(color1,n);
    dfs1(0);
    for (int i=0; i<n;i++) {
        sort(v[i].begin(),v[i].end(),cmp);
    }
    if (path.size()!=n+1 || path.size()-1!=st.size()) {
        cout<<"NO";
    }
    else {
        cout<<"YES\n";
        cout_arr(path,path.size());
    }
}

