#C8080. Number Transformation
Number Transformation
Number Transformation
Given two positive integers a and b, determine whether it is possible to transform a into b by repeatedly applying an allowed operation.
The only valid transformation is to double the number. In other words, it is possible to obtain b from a if and only if there exists a nonnegative integer k such that
\[
b = a \times 2^k
\]
This means b must be at least a and exactly equal to a multiplied by a power of 2. If the transformation is possible, output YES
; otherwise, output NO
.
Note: Although the problem description also mentions division by 2 when the number is even, the intended transformation only works when b is greater than or equal to a, effectively limiting the valid operation to repeated doubling of a.
inputFormat
The input consists of a single line containing two space-separated positive integers a and b.
outputFormat
Output a single line containing YES
if b is reachable from a using the allowed operation (i.e. b = a * 2^k for some k ≥ 0), otherwise output NO
.## sample
4 8
YES
</p>