Find whether a number can be expressed as a sum of two distinct powers of 2.
Given an integer , determine whether it can be written as:
for two different non-negative integers and .
In other words, check whether can be represented as the sum of two distinct powers of two.
If such a representation exists, print YES; otherwise print NO.
YES if can be represented as the sum of two distinct powers of two.NO.Example 1
Input
3
Output
YES
Explanation
3 = ^1.
Example 2
Input
7
Output
NO
Explanation
7 = 111_2 has three set bits, so it cannot be written as the sum of exactly two distinct powers of two.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.