use std::io::{Read, stdin}; use std::collections::BTreeSet; fn main() { let mut buf = String::new(); stdin().read_to_string(&mut buf).unwrap(); let mut tok = buf.split_whitespace(); let mut get = || tok.next().unwrap().parse::().unwrap(); let a = get(); let b = get(); if a % 2 != 0 && b % 2 != 0 { println!("No"); return; } let mut xs = vec![]; let mut hs = BTreeSet::new(); xs.push((a, b)); while !xs.is_empty() { let mut ys = vec![]; for &(a, b) in xs.iter() { if a == 0 && b == 0 { println!("Yes"); return; } let ma = a & 1; let mb = b & 1; if ma == 0 && b > 0 { let a = a >> 1; let b = b - 1; if a < b { if hs.insert((a, b)) { ys.push((a, b)); } } else { if hs.insert((b, a)) { ys.push((b, a)); } } } if mb == 0 && a > 0 { let a = a - 1; let b = b >> 1; if a < b { if hs.insert((a, b)) { ys.push((a, b)); } } else { if hs.insert((b, a)) { ys.push((b, a)); } } } } xs = ys; } println!("No"); }