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

vector<int> ans;
void dfs(map<pair<int,int>, int> a, vector<int> b, vector<int>c, int n, int v, bool ok)
{
    if (b.size()==n) {
        if (a.count(make_pair(b[b.size()-1],1))!=0) {
            ans=b;
            ans.push_back(1);
            ok=1;
        }
    }
    else {
        for (int i = 0; i<c.size();i++) {
            if (ok) break;
            if (a.count(make_pair(b[b.size()-1],c[i]))!=0) {
                v++;
                vector<int> b1 = b;
                b1.push_back(c[i]);
                vector<int> c1 = c;
                c1.erase(c1.begin()+i);
                dfs(a,b1,c1,n,v,ok);
            }
        }
        if (v>20) ok=1;

    }
    /*
1 2
1 3
1 5
2 3
3 4
4 1
5 3
5 2
    */
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,m;
    cin>>n>>m;
    map<pair<int,int>,int> a;
    for (int i = 0; i < m; i++) {
        int x,y;
        cin>>x>>y;
        a[make_pair(x,y)]=1;
    }
    if (m<n) cout<<"NO";
    else {
        vector <int> b;
        b.push_back(1);
        vector<int> c;
        for (int i = 1; i < min(n,1000); i++) {
            c.push_back(i+1);
        }
        dfs(a,b,c,n,0,0);
        if (ans.size()==0) cout<<"NO";
        else {
            cout<<"YES"<<endl;
            for (int i = 0; i < ans.size(); i++) {
                cout<<ans[i]<<" ";
            }
        }
    }
}
