#C11130. Verify Bob's Claim: Are All Numbers Powers of Two?

    ID: 40413 Type: Default 1000ms 256MiB

Verify Bob's Claim: Are All Numbers Powers of Two?

Verify Bob's Claim: Are All Numbers Powers of Two?

Bob claims that every integer in a given list is a power of two. A number is a power of two if it can be written in the form \(2^k\) for some non-negative integer \(k\). For example, 1, 2, 4, 8, 16, ... are powers of two. Your task is to verify Bob's claim. Given an integer \(T\) representing the number of integers and a list of \(T\) integers, determine whether all the integers are powers of two. If every integer is indeed a power of two, output "YES", otherwise output "NO".

inputFormat

The input is given via standard input (stdin). The first line contains a single integer \(T\) (\(1 \leq T \leq 10^5\)), representing the number of integers in the list. The second line contains \(T\) space-separated integers. Each integer \(n_i\) satisfies \(-10^9 \leq n_i \leq 10^9\).

outputFormat

Output a single line to standard output (stdout) containing "YES" if all the integers are powers of two (i.e. can be expressed as \(2^k\) for some non-negative integer \(k\)), otherwise output "NO".

## sample
4
1 2 4 8
YES