use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut l = s.lines(); for _ in 0..l.next().unwrap().parse().unwrap() { let n: Vec = l.next().unwrap().split(' ').flat_map(str::parse).collect(); let mut c = vec![0; n[0]]; for _ in 0..n[1] { l.next() .unwrap() .split(' ') .flat_map(str::parse::) .for_each(|i| c[i - 1] += 1); } c.sort(); c.dedup(); println!("{}", if c.len() < n[0] { "Yes" } else { "No" }) } }