#include <stdio.h>
#include <vector>
#include <stdlib.h>
using namespace std;

int n,k;
int qwe=0;

int obhod(int vertex,vector<int> *q,bool *a,int *w,int wl){
    a[vertex]=1;
    wl++;
    for(int i=0;i<q[vertex].size();i++){
        if(q[vertex][i]==0 && wl==n){
            wl--;
            w[wl]=vertex;
            return 1;
        }
        if(a[q[vertex][i]]==1)continue;
        if(obhod(q[vertex][i],q,a,w,wl)==1){
            wl--;
            w[wl]=vertex;
            return 1;
        }
    }
    a[vertex]=0;
    wl--;
    qwe++;
    if(qwe>2000000){
        printf("NO\n");
        exit(0);
    }
    return 0;
}

int main(){
    scanf("%d %d",&n,&k);
    vector<int> q[n];
    int t1,t2;
    for(int i=0;i<k;i++){
        scanf("%d %d",&t1,&t2);
        t1--;t2--;
        q[t1].push_back(t2);
    }
    bool a[n];
    for(int i=0;i<n;i++)a[i]=0;
    int w[n];
    int wl=0;
    if(obhod(0,q,a,w,wl)==1){
        printf("YES\n");
        for(int i=0;i<n;i++){
            printf("%d ",w[i]+1);
        }
        printf("1\n");
    }else{
        printf("NO\n");
    }
}
