There is a right triangle with legs of length *a* and *b*. Your task is to determine whether it is possible to locate the triangle on the plane in such a way that none of its sides is parallel to the coordinate axes. All the vertices must have integer coordinates. If there exists such a location, you have to output the appropriate coordinates of vertices.
The first line contains two integers *a*, *b* (1 ≤ *a*, *b* ≤ 1000), separated by a single space.
a,b = list(map(int,input().split()))
ax = []
for i in range(1,a+1):
	for j in range(1,a+1):
		if(i**2+j**2==a**2):
			ax+=[[i,j]]
			ax+=[[-i,j]]
bx = []
for i in range(1,b+1):
	for j in range(1,b+1):
		if(i**2+j**2==b**2):
			bx+=[[i,j]]
			bx+=[[-i,j]]
flag = 0
for t1 in range(len(ax)):
	if flag:
		break
	for t2 in range(len(bx)):
		x1,y1 = ax[t1][0],ax[t1][1]
		x2,y2 = bx[t2][0],bx[t2][1]
		dis = (x1-x2)**2 + (y1-y2)**2
		if(dis+a**2==b**2 or a**2+b**2==dis or dis+b**2==a**2):
			if(x1==x2 or y1==y2):
				continue
			flag = 1
			break
if flag:
	print("YES")
	print("0 0")
	print(x1,y1)
	print(x2,y2)

else:
	print("NO")

