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.
'''input
5 10
'''
# practicing a skill right after sleep improves it a lot quickly
from sys import stdin, setrecursionlimit


def pythagoreanTriplets(limits) : 
	c, m = 0, 2
	mydict = dict()
	while c < limits : 
		for n in range(1, m) : 
			a = m * m - n * n 
			b = 2 * m * n 
			c = m * m + n * n 

			# if c is greater than 
			# limit then break it 
			if c > limits : 
				break
			mydict[c] = str(a) + ' ' + str(b)
			 

		m = m + 1
	return mydict


# main starts
mydict = pythagoreanTriplets(1001)
a, b = list(map(int, stdin.readline().split()))
if a in mydict and b in mydict:
	print("YES")
	a_f, a_s = list(map(int, mydict[a].split()))
	b_f, b_s = list(map(int, mydict[b].split()))
	print(0, a_s)
	print(a_f, 0)
	if b_f/b_s == a_f/a_s:
		print(b_s, a_s + b_f)
	else:
		print(b_f, a_s + b_s)



else:
	print("NO")
