#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
const ll DIM = 1e5+7;
const ll INF = 1000000000007;

int n,m,v1,v2;
vector<int> a[DIM];
bool vis[DIM];
int flag = 0;
vector<int> ans;
unsigned long long cnt = 0;
ll t1,t2;

vector<int> dfs(int v, int step, vector<int> &way){

    cnt++;
    t2 = clock();
    if(t2-t1>=10000){
        cout << "NO" << endl;
        exit(0);
    }

    vis[v] = 1;
    way.push_back(v);
    //cout << v << ' ' << way.size() << endl;
    if((int)way.size()==n+1 && way[n]==1){
        flag = 1;
        ans = way;
        return way;
    }

    for(auto to:a[v]){
        if(to==1 || vis[to]==0){
           vector<int> kp = dfs(to,step+1,way);
        }
    }

    vis[v] = 0;
    way.pop_back();
    return way;
}

int main()
{

    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> n >> m;
    for(int i=1;i<=m;i++){
        cin >> v1 >> v2;
        a[v1].push_back(v2);
    }

   // cout << endl;

    vector<int> p;
    //p.push_back(1);

    p = dfs(1,0,p);

    t1 = clock();
    if(!flag){
        cout << "NO" << endl;
        return 0;
    }

    cout << "YES" << endl;
    for(auto to:ans)
        cout << to << ' ';

    return 0;
}
