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
x,y = map(int, input().split())
val1 = 0
val2 = 0
val3 = 0
val4 = 0
for i in range(1, 40):
    if x*x-i*i>0 and math.sqrt(x*x-i*i)==int(math.sqrt(x*x-i*i)):
        val1 = i
        val2 = int(math.sqrt(x*x-i*i))
        break
for i in range(1, 40):
    if y*y-i*i>0 and math.sqrt(y*y-i*i)==int(math.sqrt(y*y-i*i)):
        val3 = i
        val4 = int(math.sqrt(y*y-i*i))
        break
if val1==0 or val2==0 or val3==0 or val4==0:
    print("NO")
else:
    print("YES\n0 0")
    print(str(val2)+" "+str(-val1))
    print(str(val2+val3)+" "+str(-val1+val4))
