def good(n,m) if n == 0 && m == 0 :Yes elsif n < 0 or m < 0 :No elsif n.odd? and m.odd? :No elsif n.even? and m.even? if good(n/2, m-1) == :Yes or good(n-1, m/2) :Yes else :No end elsif n.even? good(n/2, m-1) else good(n-1, m/2) end end n,m=gets.split.map(&:to_i) puts good(n,m)