#include <bits/stdc++.h>

using namespace std;

#define endl "\n"
#define pb push_back
#define mp make_pair
#define in insert
#define INF 1e9
#define eps 0.0000000001
#define fi first
#define se second
#define y1 yy
#define speedup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

typedef long long ll;

//---------------------------------------|

const int DIM=1e5+7;

ll n,m,x,y,c,t,res;
vector<ll> a[DIM];
int p[DIM];
ll ans[DIM];
ll vy[DIM],vh[DIM];

//---------------------------------------|

int cm(ll v, ll nom)
{
    if (p[v]==1) return 0;
    p[v]=1;
    ans[nom]=v;
    if (nom==n)
    {
        for (auto x:a[v]) if(x==1) return 1;
        return 0;
    }

    for (auto x:a[v])
    {
        if (p[x]==1) continue;
        if (cm(x,nom+1)) return 1;
    }
    p[v]=0;
    return 0;
}

int main()
{
    speedup;

    cin >> n >> m;
    for (int i=1;i<=m;i++)
    {
        cin >> x >> y;
        a[x].pb(y);
        vh[y]=1;
        vy[x]=1;
    }
    
    for (int i=1;i<=n;i++)
    {
        if ((!vh[i])||(!vy[i]))
        {
            cout << "NO" << endl;
            return 0;
        }
    }

    if(cm(1,1))
    {
        cout << "YES" << endl;
        for (int i=1;i<=n;i++) cout << ans[i] << " ";
        cout << 1 << endl;
    }
    else cout << "NO" << endl;

    return 0;
}
