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.
import math

a, b = input().split()
c1 = int(a)**2 + int(b)**2
c2 = int(a)**2 - int(b)**2
c3 = int(b)**2 - int(a)**2
a = int(a)**2
b = int(b)**2
for i in range(1, a+1):
    if (math.sqrt(i).is_integer()) and (math.sqrt(a-i).is_integer()):
        break
for j in range(1, b+1):
    if (math.sqrt(j).is_integer()) and (math.sqrt(b-j).is_integer()) and (i != j):
        break
if (i == a) and (j == b):
    print("NO")
else:
    print("YES")
    print("0 0")
    print(int(math.sqrt(i)), int(math.sqrt(a-i)))
    print(-int(math.sqrt(j)), int(math.sqrt(b-j)))