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 = map(int, input().split())

import math
for p1x in range(1, a):
	p1y = math.sqrt(a**2 - p1x**2)
	if p1y == round(p1y):
		p2x = p1x - b*(p1y/a)
		p2y = p1y + b*(p1x/a)
		if p2x == round(p2x) and p2y == round(p2y) and p2x != 0:
			print("YES")
			print(0, 0)
			print(int(p1x), int(p1y))
			print(int(p2x), int(p2y))
			exit(0)
print("NO")