#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

using namespace std;

#define pb push_back
#define all(a) (a).begin(), (a).end()
#define endl '\n'
#define F first
#define S second
#define rs resize

using ll = long long;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using ppi = pair<int, pair<int, int>>;
using ppl = pair<ll, pair<ll, ll>>;
using vi = vector<int>;
using vl = vector<ll>;
using vpi = vector<pair<int, int>>;
using vvi = vector<vi>;
using vvpi = vector<vpi>;
using vpl = vector<pl>;
using vvl = vector<vl>;
using vvpl = vector<vpl>;
using vppl = vector<ppl>;


vvi g;
vector<bool> used;
vl ans;
void dfs(int v){
    ans.pb(v);
    used[v]=1;
    for(auto to:g[v]){
        if(used[to]) break;
        dfs(to);
    }
}
void solve()
{
    ll n, m;
    cin>>n>>m;
    used.rs(n);
    vl u(m), v(m);
    vl in(n), out(n);
    for(int i=0;i<m;i++){
        cin>>u[i]>>v[i];
        u[i]--;
        v[i]--;
        in[v[i]]++;
        out[u[i]]++;
    }
    for(int i=0;i<n;i++){
        if(in[i]==0 || out[i]==0){
            cout<<"NO"<<endl;
            return;
        }
    }
    vl tp(m);
    for(int i=m-1;i>=n;i--){
        tp[i]=1;
    }
    do{
        int ch=1;
        for(int i=0;i<m;i++){
            if(tp[i]==1){
                out[u[i]]--;
                in[v[i]]--;
            }
        }
        for(int i=0;i<n;i++){
            if(in[i]!=1 || out[i]!=1){
                ch=0;
                break;
            }
        }
        if(ch==0){
            for(int i=0;i<m;i++){
                if(tp[i]==1){
                    out[u[i]]++;
                    in[v[i]]++;
                }
            }
            continue;
        }
        g.rs(n);
        for(int i=0;i<m;i++){
            if(tp[i]==0){
                g[u[i]].pb(v[i]);
            }
        }
        dfs(0);
        for(int i=0;i<n;i++){
            if(!used[i]) ch=0;
            used[i]=0;
        }
        if(ch){
            cout<<"YES"<<endl;
            for(auto i:ans) cout<<i+1<<" ";
            cout<<ans[0]+1<<endl;
            return;
        }
        else{
            g.clear();
            ans.clear();
        }
    }while(next_permutation(all(tp)));
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while (t--)
        solve();

}
/*

*/
