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 sys
a, b = map(int, input().split())
c = (a ** 2 + b ** 2) ** 0.5
for x_a in range(-a, a + 1):
    y_a = (a ** 2 - x_a ** 2) ** 0.5
    if y_a == int(y_a):
        for x_b in range(-b, b + 1):
            y_b = (b ** 2 - x_b ** 2) ** 0.5
            if y_b == int(y_b) and y_a != y_b and x_a != y_a:
                if ((x_a - x_b) ** 2 + (y_a - y_b) ** 2) ** 0.5 == c:
                    print("YES")
                    print(0, 0)
                    print(x_a, y_a)
                    print(x_b, y_b)
                    sys.exit()
print("NO")