#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- int N,M; vector E[202020]; int yes[202020]; vector S; bitset<202020> B; void dfs() { int cur=S.back(); if(S.size()==5) { if(yes[cur]) { _P("YES\n"); exit(0); } return; } int i; FORR(e,E[cur]) { if(B[e]) continue; B[e]=1; S.push_back(e); dfs(); B[e]=0; S.pop_back(); } } void solve() { int i,j,k,l,r,x,y; string s; cin>>N>>M; FOR(i,M) { cin>>x>>y; E[x-1].push_back(y-1); E[y-1].push_back(x-1); if(x==1) yes[y-1]=1; if(y==1) yes[x-1]=1; } FOR(i,N) if(E[i].size()==1) B.set(i); S.push_back(0); B.set(0); dfs(); _P("NO\n"); } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false), cin.tie(0); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }