#include <bits/stdc++.h>

using namespace std;

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

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

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

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

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

        dfs1( to, cur );
    }
}

vector< vector<int> > grp2;

vector< vector< vector<int> > > dp;

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

    cin >> n >> m;

    grp0.assign( n+1, vector<int>() );
    grp1.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() == 1 )
        grp1[i].push_back( grp0[i][0] );

    /*for ( int i=1; i<=n; i++ )
    {
        cout << i << ": ";
        for ( auto& to : grp1[i] )
            cout << to << ' ';
        cout << '\n';
    }*/

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

    int cur = 0;

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

    for ( int i=1; i<=n; i++ )
    for ( auto& to : grp1[i] )
        org[to] = 0;

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

    /*for ( int i=1; i<=n; i++ )
        cout << i << ": " << a[i] << ' ' << in[i] << ' ' << out[i] << '\n';*/

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

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

    dp.assign( cur, vector< vector<int> >( cur, vector<int>( 1<<cur, -1 ) ) );

    for ( int i=0; i<cur; i++ )
        dp[i][i][1<<i] = 0;

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

    for ( int i=0; i<cur; i++ )
    for ( auto& to : grp2[i] )
    if ( dp[i][to][(1<<cur)-1] > 0 )
    {
        cout << "YES\n";

        vector<int> ord;

        int pos = to;
        int msk = (1<<cur)-1;

        ord.push_back( pos );

        while ( pos != i )
        {
            int nm = msk^(1<<pos);
            pos = dp[i][pos][msk];
            msk = nm;
            ord.push_back( pos );
        }

        for ( auto& v : ord )
        {
            for ( auto& el : lst[v] )
                cout << el << ' ';
        }

        cout << lst[ ord[0] ][0] << '\n';

        return 0;
    }

    cout << "NO\n";

    return 0;
}
