#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define i_7 (ll)(1E9+7) #define i_5 (ll)(1E9+5) ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; else return c+i_7; } typedef pair i_i; typedef pair l_l; ll inf=(ll)1E12;/*10^12*/ #define rep(i,l,r) for(ll i=l;i<=r;i++) #define pb push_back ll max(ll a,ll b){if(ab)return b;else return a;} //////////////////////////////////////// #define N 20005 int n,m; vectorv[N]; bool ans=false; bool al[N]; void dfs(int t,int d){ if(d==5||ans)return; else if(d==4){ for(auto x:v[t])if(x==0){ ans=true; } }else{ for(auto x:v[t]){ if(!al[x]){ al[x]=true; dfs(x,d+1); al[x]=false; } } } } int main(){ cin>>n>>m; rep(i,0,m-1){ int s,t;cin>>s>>t;s--;t--; v[s].pb(t); v[t].pb(s); } rep(i,1,n-1)al[i]=false; al[0]=true; dfs(0,0); if(ans)cout<<"YES"<