#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll INF = 100005;

ll num[INF], a[INF], used[INF];
ll n, m, k1, k2;
vector <ll> roads[INF], ans;
deque <ll> q;

void CheckStupidDfs(ll we){
    if(used[we] == 1) return;
    used[we] = 1;
    for(auto x : roads[we]){
        CheckStupidDfs(x);
    }
    return;
}


bool Ask(){
    for(int i=1; i <= n; i++){
        if(used[i] != 1) return false;
    }
    return true;
}

bool dfs(ll we, ll par){
    //cout << we << endl;
    //if(we == 1) cout << "1111!" << used[we] << endl;
    if(we == 1 && used[we] == 1){
        bool res = Ask();
        //cout << "CHECK " << res << endl;
        used[1] = 1;
        return res;
    }
    if(used[we] == 1) { /*cout << we << "endl" << endl;*/ return false; }
    used[we] = 1;
    bool is;
    q.push_back(we);

    for(auto x : roads[we]){
        if(x != par) is = dfs(x, we);
        else continue;

        if(is == true) { /*cout << we << "endl" << endl;*/ return true; }
        else{
            while(!q.empty() && q.back() != we){
                //cout << q.back() << "  ";
                used[q.back()] = 0;
                q.pop_back();
            }
            //cout << endl;
            continue;
        }
    }
    //cout << we << "endl" << endl;
    return false;
}


int main()
{
    while(!q.empty()) q.pop_front();
    scanf("%lld %lld", &n, &m);
    for(int i=1; i <= m; i++){
        scanf("%lld %lld", &k1, &k2);
        roads[k1].push_back(k2);
        //roads[k2].push_back(k1);
    }
    for(int i=1; i <= n; i++) used[i] = 0;
    CheckStupidDfs(1);
    for(int i=1; i <= n; i++){
        if(used[i] != 1){
            printf("NO\n");
            return 0;
        }
        used[i] = 0;
    }

    if(dfs(1, -1) == false){
        printf("NO\n");
        return 0;
    }
    printf("YES\n");

    while(!q.empty()){
        ans.push_back(q.front());
        q.pop_front();
    }
    //reverse(ans.begin(), ans.end());
    for(auto x : ans){
        printf("%lld ", x);
    }
    printf("1\n");

    return 0;
}
