Chouti is working on a strange math problem.

There was a sequence of $n$ positive integers $x_1, x_2, \ldots, x_n$, where $n$ is even. The sequence was very special, namely for every integer $t$ from $1$ to $n$, $x_1+x_2+...+x_t$ is a square of some integer number (that is, a perfect square).

Somehow, the numbers with odd indexes turned to be missing, so he is only aware of numbers on even positions, i.e. $x_2, x_4, x_6, \ldots, x_n$. The task for him is to restore the original sequence. Again, it's your turn to help him.

The problem setter might make mistakes, so there can be no possible sequence at all. If there are several possible sequences, you can output any.


-----Input-----

The first line contains an even number $n$ ($2 \le n \le 10^5$).

The second line contains $\frac{n}{2}$ positive integers $x_2, x_4, \ldots, x_n$ ($1 \le x_i \le 2 \cdot 10^5$).


-----Output-----

If there are no possible sequence, print "No".

Otherwise, print "Yes" and then $n$ positive integers $x_1, x_2, \ldots, x_n$ ($1 \le x_i \le 10^{13}$), where $x_2, x_4, \ldots, x_n$ should be same as in input data. If there are multiple answers, print any.

Note, that the limit for $x_i$ is larger than for input data. It can be proved that in case there is an answer, there must be a possible sequence satisfying $1 \le x_i \le 10^{13}$.


-----Examples-----
Input
6
5 11 44

Output
Yes
4 5 16 11 64 44

Input
2
9900

Output
Yes
100 9900

Input
6
314 1592 6535

Output
No



-----Note-----

In the first example   $x_1=4$  $x_1+x_2=9$  $x_1+x_2+x_3=25$  $x_1+x_2+x_3+x_4=36$  $x_1+x_2+x_3+x_4+x_5=100$  $x_1+x_2+x_3+x_4+x_5+x_6=144$  All these numbers are perfect squares.

In the second example, $x_1=100$, $x_1+x_2=10000$. They are all perfect squares. There're other answers possible. For example, $x_1=22500$ is another answer.

In the third example, it is possible to show, that no such sequence exists.

Source: codeforces | Difficulty: HARD
Tags: Constructive algorithms

Sorting

Greedy algorithms

Number theory

Mathematics


Solutions:
import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=-10 ** 6, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(200001)]
pp = [0] * 200001

def SieveOfEratosthenes(n=200000):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = 0
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] > key:
			right = mid - 1
		else:
			res = mid + 1
			left = mid + 1
	return res
n = int(input())
l = list(map(int, input().split()))
w = []
cou = 1

def isPer(n):
	if int(math.sqrt(n) + 0.2) ** 2 == n:
		return True
	return False

def nextSquare(n):
	i = int(math.ceil(math.sqrt(n)))
	if i * i == n:
		i += 1
	return i
i = 0
s = 0
while i < n // 2:
	if isPer(cou * cou + l[i]):
		w.append(cou ** 2 - s)
		w.append(l[i])
		cou = nextSquare(cou ** 2 + l[i])
		s += w[-2] + w[-1]
		i += 1
	else:
		cou += 1
		if cou > l[i] // 2:
			print('No')
			sys.exit()
print('Yes')
print(*w)


import sys
import math
n = int(input())
A = list(map(int, input().split()))
ANS = [None] * (n // 2 + 1)
ANS[0] = [0, 0]
for i in range(n // 2):
	NEXT = []
	z = A[i]
	xr = math.ceil(math.sqrt(z))
	LIST = []
	for j in range(1, xr + 1):
		if z % j == 0:
			LIST.append(j)
	for l in LIST[::-1]:
		if (l + z // l) % 2 == 1:
			continue
		y = (l + z // l) // 2
		x = y - l
		(_, N) = ANS[i]
		if x ** 2 > N:
			NEXT = [x ** 2, y ** 2]
			break
	if NEXT == []:
		print('No')
		sys.exit()
	ANS[i + 1] = NEXT
print('Yes')
for i in range(1, n // 2 + 1):
	print(ANS[i][0] - ANS[i - 1][1], end=' ')
	print(ANS[i][1] - ANS[i][0], end=' ')


import math

def completar_lista(lista, n):
	X = []
	s = 0
	cadena = ''
	for x in lista:
		parar = True
		for div1 in range(int(math.sqrt(x)), 0, -1):
			if x % div1 == 0:
				div2 = x // div1
				if (div1 + div2) % 2 == 0:
					s_1 = ((div2 - div1) // 2) ** 2
					if s_1 > s:
						temp = s_1 - s
						X.append(temp)
						X.append(x)
						s = s + temp + x
						parar = False
						break
		if parar:
			return None
	return X
n = int(input())
lista = map(int, input().split())
lista_entera = completar_lista(lista, n // 2)
if lista_entera is None:
	print('No')
else:
	print('Yes')
	print(*lista_entera)


from math import sqrt
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
x = 1
tot = 0
flag = 1
for i in range(n // 2):
	ans[2 * i + 1] = a[i]
	while x <= 1000000:
		if x * x > tot and (x * x + a[i]) ** 0.5 % 1 == 0:
			ans[2 * i] = x * x - tot
			break
		x += 1
	if x >= 1000000:
		flag = -1
		break
	tot += ans[2 * i] + ans[2 * i + 1]
if flag == -1:
	print('No')
else:
	print('Yes')
	print(*ans)


import math
n = int(input())
a = list(map(int, input().split()))
r = lambda y: int(math.sqrt(y))

def R(x):
	y = r(x)
	return y * y == x
z = 0
b = []
for i in a:
	f = 0
	for q in range(r(z) + 1, 3160000):
		y = q * q - z
		if R(q * q + i):
			b += [y, i]
			z += i + y
			f = 1
			break
	if f < 1:
		print('No')
		return
print('Yes\n', *b)


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
l = list(map(int, input().split()))
w = []
cou = 1

def isPer(n):
	if int(math.sqrt(n) + 0.2) ** 2 == n:
		return True
	return False

def nextSquare(n):
	i = int(math.ceil(math.sqrt(n)))
	if i * i == n:
		i += 1
	return i
i = 0
s = 0
while i < n // 2:
	if isPer(cou * cou + l[i]):
		w.append(cou ** 2 - s)
		w.append(l[i])
		cou = nextSquare(cou ** 2 + l[i])
		s += w[-2] + w[-1]
		i += 1
	else:
		cou += 1
		if cou > l[i] // 2:
			print('No')
			sys.exit()
print('Yes')
print(*w)


from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def check(x):
	x1 = int(sqrt(x))
	return x1 * x1 == x

def solve():
	n = ii()
	a = li()
	tmp = [0] * n
	tot = 0
	x = 1
	for i in range(n // 2):
		tmp[2 * i + 1] = a[i]
		while x < 1000000:
			if x * x > tot and check(x * x + a[i]):
				tmp[2 * i] = x * x - tot
				break
			x += 1
		if x == 1000000:
			print('No')
			exit(0)
		tot += tmp[2 * i] + a[i]
	print('Yes')
	print(*tmp)
solve()


n = int(input()) // 2
s = list(map(int, input().split()))
sqs = [0] * (2 * n + 2)
sqs[-1] = sqs[-2] = 999999999999999999
for i in range(n - 1, -1, -1):
	N = s[i]
	d = 1
	sqi = sqi_1 = -1
	while d * d <= N:
		if N % d == 0:
			f = N // d
			if (f + d) % 2:
				d += 1
				continue
			if d == (d + f) // 2:
				d += 1
				continue
			sqi = (d + f) // 2
			sqi_1 = abs(d - sqi)
			if sqs[i * 2 + 2] > sqi:
				break
		d += 1
	if sqi == -1:
		exit(print('No'))
	sqs[i * 2 + 1] = sqi
	sqs[i * 2] = sqi_1
if sqs != sorted(sqs):
	exit(print('No'))
cs = 0
print('Yes')
for i in sqs[:-2]:
	print(i * i - cs, end=' ')
	cs += i * i - cs


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict, OrderedDict
import math
import heapq

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()

def perfectSquare(k):
	s = math.sqrt(k)
	if s - int(s) == 0:
		return 1
	else:
		return 0

def check(a, b, op, i):
	(e1, e2) = (a, b)
	if op == '-':
		diff = e2 - e1
	else:
		diff = e2 + e1
	if perfectSquare(diff):
		if diff - arr[i - 1] > 0 or i == 0:
			arr[i] = diff
			arr[i + 1] = e2
			return 1
		else:
			return 0
	else:
		return 0
n = intIn()
even = listIn()
arr = [0] * n
j = 0
for i in range(n):
	if i % 2 != 0:
		arr[i] = even[j]
		j += 1
k = 0
l = 0
s = 0
zcnt = 0
b_end = 10 ** 13
flag = False
for i in range(0, n, 2):
	found = False
	while not found:
		k += 1
		if k * k - s > b_end:
			print('No')
			exit(0)
		forward_sum = k * k + arr[i + 1]
		while forward_sum > l * l:
			l += 1
		if forward_sum == l * l:
			found = True
			arr[i] = k * k - s
			s = forward_sum
			k = l
print('Yes')
print(*arr)


from __future__ import division, print_function
import cmath
import itertools
import math
import operator as op
import sys
from atexit import register
from bisect import bisect_left, bisect_right
if sys.version_info[0] < 3:
	from io import BytesIO as stream
else:
	from functools import reduce
	from io import StringIO as stream
	from math import gcd
if sys.version_info[0] < 3:

	class dict(dict):

		def items(self):
			return dict.iteritems(self)

		def keys(self):
			return dict.iterkeys(self)

		def values(self):
			return dict.itervalues(self)

	def gcd(x, y):
		while y:
			(x, y) = (y, x % y)
		return x
	input = raw_input
	range = xrange
	filter = itertools.ifilter
	map = itertools.imap
	zip = itertools.izip

def sync_with_stdio(sync=True):
	global input, flush
	if sync:
		flush = sys.stdout.flush
	else:
		sys.stdin = stream(sys.stdin.read())
		input = lambda : sys.stdin.readline().rstrip('\r\n')
		sys.stdout = stream()
		register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))

def memodict(f):

	class memodict(dict):

		def __missing__(self, key):
			ret = self[key] = f(key)
			return ret
	return memodict().__getitem__

@memodict
def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1, 2 if n % 2 else 1) if n % i == 0)))

def main():
	n = int(input())
	x = list(map(int, input().split(' ')))
	(a, b) = (0, 0)
	f = all_factors(x[0])
	for fi in f:
		if (fi + x[0] // fi) % 2 == 0:
			na = (fi + x[0] // fi) // 2
			nb = fi - na if fi > na else x[0] // fi - na
			if a == 0 or b == 0:
				(a, b) = (na, nb)
			elif na < a:
				(a, b) = (na, nb)
	if a == 0 or b == 0:
		print('No')
		return
	res = [b * b, x[0]]
	pref_sum = sum(res)
	for i in range(1, n // 2):
		(a, b) = (0, 0)
		pref_sum += x[i]
		f = all_factors(x[i])
		for fi in f:
			if (fi + x[i] // fi) % 2 == 0:
				na = (fi + x[i] // fi) // 2
				nb = fi - na if fi > na else x[i] // fi - na
				if na * na > pref_sum:
					if a == 0 or b == 0:
						(a, b) = (na, nb)
					elif na < a:
						(a, b) = (na, nb)
		if a == 0 or b == 0:
			print('No')
			return
		res.append(a * a - pref_sum)
		pref_sum += res[-1]
		res.append(x[i])
	print('Yes')
	print(*res)
sync_with_stdio(False)
main()


import math
n = int(input())
cl = list(map(int, input().split()))
sm = 0

def func(p, q):
	if q % 2 != 0 or q % 4 == 0:
		for i in range(int(math.sqrt(q)), 0, -1):
			if q % i == 0 and (i + q // i) % 2 == 0:
				k = ((q // i - i) // 2) ** 2
				if k > p:
					return k - p
		return -1
	else:
		return -1
res = []
for i in range(n // 2):
	e = func(sm, cl[i])
	if e == -1:
		print('No')
		return
	res.append(e)
	res.append(cl[i])
	sm += e + cl[i]
print('Yes')
print(*res)


import sys
from math import sqrt
n = int(input())
I = list(map(int, input().split()))
ans = [0] * (n + 1)
sums = [0] * (n + 1)
for i in range(1, len(I) + 1):
	ans[2 * i] = I[i - 1]

def calc(before, after, cur):
	global ans, sums
	for i in range(int(sqrt(after)), 0, -1):
		if after % i != 0 or (i + after // i) % 2 != 0:
			continue
		else:
			(a, b) = ((i - after // i) // 2, (i + after // i) // 2)
			if a ** 2 > before:
				(sums[cur], sums[cur + 1]) = (a ** 2, b ** 2)
				ans[cur] = a ** 2 - before
				return
	print('No')
	sys.exit()
for i in range(1, n + 1):
	if i % 2 == 1:
		calc(sums[i - 1], ans[i + 1], i)
print('Yes')
print(*ans[1:])


Z = 100000
n = int(input())
xx = list(map(int, input().split()))

def cal():
	ans = []
	a = 1
	b = 1
	s = 0
	ls = 1
	for x in xx:
		while b <= Z:
			if s < x:
				s += b * 2 + 1
				b += 1
			elif s > x:
				s -= a * 2 + 1
				ls += a * 2 + 1
				a += 1
			else:
				ans.append(ls)
				ans.append(x)
				ls = b * 2 + 1
				b += 1
				a = b
				s = 0
				break
		else:
			return
	return ans
ans = cal()
if ans:
	print('Yes')
	print(' '.join(map(str, ans)))
else:
	print('No')


import collections
import time
import os
import sys
import bisect
import heapq
import bisect
S = 2 * 10 ** 5 + 5
V = collections.defaultdict(list)
for i in range(1, S + 1):
	if 2 * i + 1 > S:
		break
	j = i + 1
	while j * j - i * i <= S:
		V[j * j - i * i].append((i, j))
		j += 1
N = int(input())
X = [int(x) for x in input().split()]
ans = [0] * (N + 1)
xi = 0
for i in range(2, N + 1, 2):
	x = X[xi]
	xi += 1
	for v in V[x]:
		if ans[i - 2] < v[0]:
			ans[i - 1] = v[0]
			ans[i] = v[1]
			break
	if ans[i - 1] == 0:
		print('No')
		return
print('Yes')
print(' '.join(map(str, [ans[i] ** 2 - ans[i - 1] ** 2 for i in range(1, N + 1)])))


def bi(a, x):
	l = -1
	u = len(a)
	while u - l > 1:
		md = int((l + u) / 2)
		if x >= a[md]:
			l = md
		else:
			u = md
	return u
d = {}
for x in range(1, 100000):
	for a in range(1, 500):
		diff = a * a + 2 * a * x
		if diff > 200000:
			break
		if diff not in d:
			d[diff] = []
		d[diff].append(x * x)

def solve(a, d):
	cur = 0
	ans = ''
	for x in a:
		if x not in d:
			return ('No', '')
		next_ = bi(d[x], cur)
		if next_ == len(d[x]):
			return ('No', '')
		next_ = d[x][next_]
		ans += str(next_ - cur) + ' ' + str(x) + ' '
		cur = next_ + x
	return ('Yes', ans)
n = int(input())
a = list(map(int, input().split()))
ans = solve(a, d)
print(ans[0])
print(ans[1])


import math
n = int(input())
x = list(map(int, input().split()))
currsum = 0
others = []
done = False
for i in range(n // 2):
	a = x[i]
	sml = None
	big = None
	if a % 4 == 2:
		print('No')
		done = True
		break
	elif a % 2 == 1:
		for i in range(1, math.ceil(-currsum + (currsum ** 2 + a) ** 0.5), 2):
			if a % i == 0:
				sml = ((a - i ** 2) // (2 * i)) ** 2
				big = sml + a
	else:
		for i in range(2, math.ceil(-currsum + (currsum ** 2 + a) ** 0.5), 2):
			if a % (2 * i) == 0:
				sml = ((a - i ** 2) // (2 * i)) ** 2
				big = sml + a
	if sml == None:
		print('No')
		done = True
		break
	others.append(sml - int(currsum) ** 2)
	currsum = big ** 0.5
if not done:
	out = ''
	for i in range(n // 2):
		out += str(others[i]) + ' ' + str(x[i]) + ' '
	print('Yes')
	print(out[:-1])