#C5822. Double Pattern Check

    ID: 49514 Type: Default 1000ms 256MiB

Double Pattern Check

Double Pattern Check

You are given a sequence of n integers. The goal is to determine whether the sequence forms a double pattern. A sequence has a double pattern if for every index i (2 ≤ in), the i-th number is exactly twice the (i-1)-th number, i.e. it satisfies the relation:

\(a_i = 2 \times a_{i-1}\)

If the entire sequence follows this rule, output Yes, otherwise output No.

Input Format: The first line contains an integer n (n ≥ 2). The second line contains n integers separated by spaces.

Output Format: A single line containing either Yes or No.

inputFormat

The first line contains an integer n (n ≥ 2), which represents the number of integers in the sequence. The second line contains n space-separated integers representing the sequence.

outputFormat

Output a single line with Yes if every integer (except the first) is double the previous one; otherwise, output No.

## sample
4
2 4 8 16
Yes

</p>