#include <bits/stdc++.h>
#define ll long long 
#define ull unsigned ll
#define dbl double

using namespace std;

const int N = 1e5 + 10;
vector <int> g[N];
int n;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

	int m;
    cin >> n >> m;
    for (int mm = 0; mm < m; ++mm)
    {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
    }

    if (n < 21)
    {
        int start = 1;
        priority_queue < pair <int, vector <int> > > q;
        vector <int> s;
        s.push_back(start);
        q.push({s.size(), s});
        s.clear();

        while (!q.empty())
        {
            pair <int, vector <int> > cur = q.top();
            q.pop();

            s = cur.second;
            int v = s[s.size() - 1];
            if (s.size() == n)
            {
                for (int i = 0; i < g[v].size(); ++i)
                    if (g[v][i] == start)
                    {
                        cout << "YES" << endl;
                        for (int i = 0; i < s.size(); ++i)
                            cout << s[i] << " ";
                        cout << start;
                        return 0;                     
                    }
            }
            else
            {
                int v = s[s.size() - 1];
                bool used[N] = {};
                for (int i = 0; i < s.size(); ++i)
                    used[s[i]] = true;

                for (int i = 0; i < g[v].size(); ++i)
                    if (!used[g[v][i]])
                    {
                        vector <int> next = s;
                        next.push_back(g[v][i]);
                        q.push({next.size(), next});
                    }
            }
        }

        cout << "NO";
    }
    cout << "NO";
}
