358. Is the Tree Complete
A complete binary tree has every level full except possibly the last, and the last level filled from the left with no gaps.
Print Yes if the tree is complete and No otherwise.
A level-order walk makes this simple. Enqueue children including the absent ones, and the tree is complete exactly when no real node appears after the first absence.
That single rule covers both conditions at once. A missing left child with a present right child fails immediately, and so does a hole anywhere earlier than the end of the last row.
Constraints - `1 ≤ n ≤ 100000` - `-1000000000 ≤ value ≤ 1000000000` - The input always forms a valid tree rooted at node 1.
Input
The first line contains an integer n, the number of nodes.
The second line contains n values, where node i holds the ith value.
Each of the next n lines contains two integers, the left and right child of
node i, using 0 for no child. Node 1 is the root.
Output
Print Yes or No on one line.