use std::io::{Read, stdin}; use std::collections::HashSet; 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 = HashSet::new(); xs.push((a, b)); while let Some((a, b)) = xs.pop() { if a == 0 && b == 0 { println!("Yes"); return; } let ma = a & 1; let mb = b & 1; if ma == 0 && b > 0 { let mut a = a >> 1; let mut b = b - 1; if a > b { let c = a; a = b; b = c; } if hs.insert((a, b)) { xs.push((a, b)); } } if mb == 0 && a > 0 { let mut a = a - 1; let mut b = b >> 1; if a > b { let c = a; a = b; b = c; } if hs.insert((a, b)) { xs.push((a, b)); } } } println!("No"); }