#include using namespace std; #define REP(i,n) for(int i=0;i ostream& operator<<(ostream& os,const vector& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; } typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef vector vi; typedef vector vvi; int N,M; vector G[200001]; vector use; bool dfs(int cur,int num,vector& vis){ if(num!=5 and cur==0){ return false; } if(num==5){ if(cur==0) return true; else return false; } for(int v : vis) if(v == cur ) return false; //cout << cur << " " << num << " : " << vis << endl; vector nv(vis); nv.push_back(cur); for(int v : G[cur]){ if(dfs(v,num+1,nv)){ return true; } } return false; } int main(){ cin>>N>>M; rep(i,M){ int a,b; cin>>a>>b; a--,b--; G[a].push_back(b); G[b].push_back(a); } int c=0; for(int sv : G[0]){ //debug(sv); // use.assign(N,false); vector v; bool f=dfs(sv,1,v); //debug(f); if(f){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }