Mr. Mario and His Imaginary World

wrench786 Unlock The Algorithm, Spr...
Limits 1s, 256 MB

Mario is a fictional character who loves the number 22 and lives in an imaginary world. In that world, there is only one grocery shop available. The shop has all kinds of groceries available, and only six types of coins are available in the cash box: [1,2,4,8,16,32][1, 2, 4, 8, 16, 32].

Every day, Mario buys necessary groceries from that shop. He always pays greater than his total bill. As a result, the Shopkeeper needs to provide changes to him. The Shopkeeper always returns the changes optimally, but when the Shopkeeper returns the changes, he uses every coin only once.

Mario will be happy if his favorite number is available in the change. As you are good at Programming, he wanted your help. Now write a program to check whether Mario's favorite coin is available in the change.


For each test case you will be given two integer numbers TT and PP (1T<P109;0<PT63)(1 \le T < P \le 10^{9} ; 0 < P-T \le 63) where TT is the total bill and PP is the amount given by Mario to the shopkeeper. The shopkeeper gives the necessary changes for the amount PTP-T. Here PP is always greater than TT.


Print "Yes" if Mario's favorite coin is available in the change. Otherwise, print "No" (Without quotation marks).


79 101
23 31


Login to submit.


81% Solution Ratio
iffatul_anonEarliest, 4M ago
Boni213_154366Fastest, 0.0s
Paul72Lightest, 4.9 MB
abrar03Shortest, 267B
Toph uses cookies. By continuing you agree to our Cookie Policy.