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())
pos = []
def circle(x, y, r):
    return (x)**2 + (y)**2 == r**2

for i in range(a+1):
    for j in range(a+1):
        if circle(i, j, a) and i!=0 and j!=0:
            pos.append((i, j))
pos2 = []
for i in range(b+1):
    for j in range(b+1):
        if circle(i,j,b) and i!=0 and j!=0:
            pos2.append((i,j))
f = False
for p, q in pos:
    for r, s in pos2:
        if p!=r and q!=s:
            f = True
            print("YES")
            print(0,0)
            print(p,q)
            print(r,s)
            break
    if f:
        break
else:
    print("NO")
