#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

#define For(i,a , n)for(ll i = a;i<(ll)n;i++)
#define vec vector
#define all(x) begin(x), end(x)
#define sz(x)(ll)size(x)

template<class A, class B>
pair<A, B> operator+(const pair<A, B>& a, const pair<A, B>& b){
    return {a.first + b.first, a.second + b.second};
}

template<class A, class B>
ostream& operator<<(ostream& os, const pair<A, B>& a){
    return os<<"("<<a.first<<", "<<a.second<<")";
}

template<class A, class B, class C>
basic_ostream<A, B>& operator<<(basic_ostream<A, B>& os, const C& c){
    for(auto itr = begin(c);itr!=end(c);++itr){
        os<<(itr==begin(c)?"":" ")<<*itr;
    }
    return os;
}

template<typename... Args>
void dbg(Args&&... args){
    ((cerr<<args<<"| "),...);
    cerr<<endl;
}

void solve(){
    ll n, m;cin>>n>>m;
    vec<vec<pll>> potrebujem(n + 1);
    For(i, 0, m){
        ll a, b;cin>>a>>b;
        if(a > b) potrebujem[a].push_back({a, b});
        if( b > a) potrebujem[b].push_back({a, b});
    }
    // dbg(potrebujem);
    vec<vec<ll>> ans(3, {1});
    For(x, 2, n + 1){
        ll ss = sz(ans[0]);
        ll mam_moznost = false;
        For(i, 0, ss + 1){
            if(mam_moznost)break;
            map<pll, ll> counts1;
            For(c, 0, ss){
                if(c < i){
                    counts1[{ans[0][c], x}]++;
                }
                else{
                    counts1[{x, ans[0][c]}]++;
                }
            }
            For(j, 0, ss + 1){
                if(mam_moznost)break;
                map<pll, ll> counts2;
                For(c, 0, ss){
                    if(c < j){
                        counts2[{ans[1][c], x}]++;
                    }
                    else{
                        counts2[{x, ans[1][c]}]++;
                    }
                }
                For(k, 0, ss + 1){
                    if(mam_moznost)break;
                    map<pll, ll> counts3;
                    For(c, 0, ss){
                        if(c < k){
                            counts3[{ans[2][c], x}]++;
                        }
                        else{
                            counts3[{x, ans[2][c]}]++;
                        }
                    }
                    map<pll, ll> vsetky;
                    for(auto i : counts1)vsetky[i.first]+=i.second;
                    for(auto i : counts2)vsetky[i.first]+=i.second;
                    for(auto i : counts3)vsetky[i.first]+=i.second;
                    bool ok = true;
                    for(auto i : vsetky)if(i.second == 3)ok = false;
                    for(auto c : potrebujem[x]){
                       if(vsetky[c] != 2) ok = false; 
                    }
                    if(ok == true){
                        // dbg(x,"mam moznost", i, j, k);
                        vec<ll> kam = {i, j, k};
                        vec<vec<ll>> nans(3);
                        For(z, 0, 3){
                            For(c, 0, ss){
                                if(c== kam[z])nans[z].push_back(x);
                                nans[z].push_back(ans[z][c]);
                            }
                            if(kam[z] == ss)nans[z].push_back(x);
                            // dbg(nans[z]);
                        }
                        ans = nans;
                        mam_moznost=true;
                        break;
                    }
                }
            }
        }
    }
    // dbg(ans);
    cout<<"YES\n3\n";
    For(i, 0, 3)cout<<ans[i]<<endl;
}

int main(){
    cin.tie(0)->sync_with_stdio(0);
    cin.exceptions(cin.failbit);
    ll t = 1; // cin>>t;
    while(t--)solve();
}