use std::io::{Read, stdin}; 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![]; xs.push((a, b)); while let Some((a, b)) = xs.pop() { // if a == 0 && b == 0 { 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; xs.push((a, b)); } if mb == 0 && a > 0 { let a = a - 1; let b = b >> 1; xs.push((a, b)); } } println!("No"); }