use std::collections::{HashSet, VecDeque}; fn main() { let mut nm = String::new(); std::io::stdin().read_line(&mut nm).ok(); let nm: Vec = nm.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nm[0]; let m = nm[1]; let mut paths = vec![vec![]; n]; for i in 0..m { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec = temp.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let a = temp[0]-1; let b = temp[1]-1; paths[a].push((b, i)); paths[b].push((a, i)); } let mut cnt = 0usize; let mut deque = VecDeque::new(); for i in 0..n { if paths[i].len() == 1 { deque.push_back((i, paths[i][0].0, paths[i][0].1)); } } let mut checked = vec![false; m]; while let Some((l, r, idx)) = deque.pop_front() { if checked[idx] { continue; } if paths[l].len() == 1 && paths[l][0].0 == r { paths[l].pop(); } else { if let Some(idx) = paths[l].iter().enumerate().filter(|&(_, &j)| j.1 == idx).map(|(i, _)| i).nth(0) { paths[l].remove(idx); if paths[l].len() == 1 { deque.push_back((l, paths[l][0].0, paths[l][1].1)); } } } if paths[r].len() == 1 && paths[r][0].0 == l { paths[r].pop(); } else { if let Some(idx) = paths[r].iter().enumerate().filter(|&(_, &j)| j.1 == idx).map(|(i, _)| i).nth(0) { paths[r].remove(idx); if paths[r].len() == 1 { deque.push_back((r, paths[r][0].0, paths[r][0].1)); } } } checked[idx] = true; cnt += 1; } println!("{}", if cnt % 2 == 1 { "Yes" } else { "No" }); }