#arc135b. [arc135_b]Sum of Three Terms

[arc135_b]Sum of Three Terms

Problem Statement

You are given a sequence of NN integers S=(S1,ldots,SN)S = (S_1, \\ldots, S_N). Determine whether there is a sequence of N+2N+2 integers A=(A1,ldots,AN+2)A = (A_1, \\ldots, A_{N+2}) that satisfies the conditions below.

  • 0leqAi0\\leq A_i for every ii (1leqileqN+21\\leq i\\leq N+2).
  • Si=Ai+Ai+1+Ai+2S_i = A_{i} + A_{i+1} + A_{i+2} for every ii (1leqileqN1\\leq i\\leq N).

If it exists, print one such sequence.

Constraints

  • 1leqNleq3times1051\\leq N\\leq 3\\times 10^5
  • 0leqSileq1090\\leq S_i\\leq 10^9

Input

Input is given from Standard Input from the following format:

NN S1S_1 ldots\\ldots SNS_N

Output

If there is a sequence AA that satisfies the conditions, print Yes; otherwise, print No. In the case of Yes, print an additional line containing the elements of such a sequence AA, separated by spaces.

A1A_1 ldots\\ldots AN+2A_{N+2}

If there are multiple sequences satisfying the conditions, you may print any of them.


Sample Input 1

5
6 9 6 6 5

Sample Output 1

Yes
0 4 2 3 1 2 2

We can verify that Si=Ai+Ai+1+Ai+2S_i = A_i + A_{i+1} + A_{i+2} for every ii (1leqileqN1\\leq i\\leq N), as follows.

  • 6=0+4+26 = 0 + 4 + 2.
  • 9=4+2+39 = 4 + 2 + 3.
  • 6=2+3+16 = 2 + 3 + 1.
  • 6=3+1+26 = 3 + 1 + 2.
  • 5=1+2+25 = 1 + 2 + 2.

Sample Input 2

5
0 1 2 1 0

Sample Output 2

No

Sample Input 3

1
10

Sample Output 3

Yes
0 0 10