#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,m;
    cin>>n>>m;
    bool a[n+1][n+1]={false};
    for (ll i=0;i<m;i++)
    {
        ll r,l;
        cin>>l>>r;
        a[l][r]=true;
    }
    vector <ll> v;
    for (ll i=2;i<=n;i++)
    {
        v.push_back(i);
    }
    for (ll q=1;q<10000;q++)
    {
        bool f=1;
        for (ll i=1;i<v.size();i++)
        {
            if (a[v[i-1]][v[i]]!=true) {i=n;f=0;}
        }
        if (f)
        {
            if (a[v[v.size()-1]][1]==true && a[1][v[0]]==true) 
            {
                cout<<"YES\n1 ";
                for (ll i=0;i<v.size();i++)
                    cout<<v[i]<<" ";
                cout<<1<<endl;
                return 0;
            }
        }
        next_permutation(v.begin(),v.end());
    }
    cout<<"NO";
}

