#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="< graph[N]; int color[N]; bool dp[MK][N]; void dfs(int p, int mask){ if(dp[mask][p]) return; dp[mask][p] = true; for(auto to : graph[p]){ if(to!=0 && (mask&color[to])==0) dfs(to, mask|color[to]); } } int main(){ int n,m; cin>>n>>m; rep(i,m){ int a,b; scanf("%d %d", &a, &b); a--;b--; graph[a].pb(b); graph[b].pb(a); } color[0]=0; rep(reps, 500){ repl(i,1,n) color[i] = 1<<(rand()%4); fill(dp[0], dp[MK], false); dfs(0,0); for(auto t : graph[0]) if(dp[MK-1][t]){ cout<<"YES"<