#include <bits/stdc++.h>

using namespace std;

int n, m;
vector< vector<int> > grp0, grp1;
vector<int> used;

bool dfs_clc ( int v, int st, int cnt, vector<int> &ans )
{
    used[v] = true;

    for ( auto& to : grp1[v] )
    {
        if ( to == st && cnt == n )
        {
            ans.push_back( to );
            ans.push_back( v );
            return true;
        }

        if ( !used[to] && dfs_clc( to, st, cnt+1, ans ) )
        {
            ans.push_back( v );
            return true;
        }
    }

    return false;
}

vector<int> a, in, out;
vector< vector<int> > lst;

void dfs1 ( int v, int cur )
{
    a[v] = cur;
    lst[cur].push_back( v );

    if ( grp1[v].size() == 0 )
    {
        out[v] = 1;
        return;
    }

    if ( a[ grp1[v][0] ] != -1 )
    {
        cout << "NO\n";
        exit(0);
    }

    dfs1( grp1[v][0], cur );
}

vector< vector<int> > grp2, tran2;
vector< vector<int> > dp;

int main ()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> m;

    grp0.assign( n+1, vector<int>() );

    for ( int i=0; i<m; i++ )
    {
        int u, v;
        cin >> u >> v;
        grp0[u].push_back(v);
    }

    for ( int i=1; i<=n; i++ )
    if ( grp0[i].size() == 0 )
    {
        cout << "NO\n";
        return 0;
    }

    {
        vector<int> good( n+1, 0 );

        for ( int i=1; i<=n; i++ )
        for ( auto& to : grp0[i] )
            good[to] = 1;

        for ( int i=1; i<=n; i++ )
        if ( !good[i] )
        {
            cout << "NO\n";
            return 0;
        }
    }

    grp1.assign( n+1, vector<int>() );

    for ( int i=1; i<=n; i++ )
    if ( grp0[i].size() == 1 )
        grp1[i].push_back( grp0[i][0] );

    {
        used.assign( n+1, 0 );
        vector<int> ans;

        if ( dfs_clc( 1, 1, 1, ans ) )
        {
            reverse( ans.begin(), ans.end() );

            cout << "YES\n";
            for ( auto& el : ans )
                cout << el << ' ';
            return 0;
        }
    }

    vector<int> org( n+1, 1 );

    for ( int i=1; i<=n; i++ )
    if ( grp1[i].size() )
        org[ grp1[i][0] ] = 0;

    int cur = 0;

    in.assign( n+1, 0 );
    out.assign( n+1, 0 );
    a.assign( n+1, -1 );

    for ( int i=1; i<=n; i++ )
    if ( org[i] )
    {
        in[i] = 1;
        lst.push_back({});
        dfs1( i, cur );
        cur++;
    }

    if ( cur == 0 ) // assert
    {
        cout << "NO\n";
        return 0;
    }

    grp2.assign( cur, vector<int>() );
    tran2.assign( cur, vector<int>() );

    for ( int i=1; i<=n; i++ )
    for ( auto& to : grp0[i] )
    if ( out[i] && in[to] )
    {
        grp2[ a[i] ].push_back( a[to] );
        tran2[ a[to] ].push_back( a[i] );
    }

    for ( int st=0; st<cur; st++ )
    {
        dp.assign( 1<<cur, vector<int>( cur, -1 ) );

        dp[1<<st][st] = 0;

        for ( int msk=1; msk < (1<<cur); msk++ )
        for ( int i=0; i<cur; i++ )
        if ( dp[msk][i] != -1 )
        for ( auto& to : grp2[i] )
        if ( !( (msk>>to) & 1 ) )
            dp[ msk | (1<<to) ][to] = i;

        int full = (1<<cur)-1;

        for ( auto& to : tran2[st] )
        if ( dp[full][to] != -1 )
        {
            cout << "YES\n";

            vector<int> ord;

            int pos = to;
            int msk = full;

            ord.push_back(pos);

            while ( pos != st )
            {
                int nw = msk ^ (1<<pos);
                pos = dp[msk][pos];

                ord.push_back( pos );

                msk = nw;
            }

            reverse( ord.begin(), ord.end() );

            vector<int> ans;

            for ( auto& g : ord )
            for ( auto& el : lst[g] )
            {
                //cout << el << ' ';
                ans.push_back( el );
            }

            //ans.push_back( lst[st][0] );
            //cout << lst[st][0] << '\n';

            int q = ans.size();

            int pout = 0;

            for ( int i=0; i<q; i++ )
            if ( ans[i] == 1 )
                pout = i;

            cout << ans[pout] << ' ';
            pout = ( pout + 1 ) % q;

            while ( ans[pout] != 1 )
            {
                cout << ans[pout] << ' ';
                pout = ( pout + 1 ) % q;
            }

            cout << "1\n";

            return 0;
        }
    }

    cout << "NO\n";

    return 0;
}
