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
EPS = 1e-9

for x1 in range(1, a):
    y1 = math.sqrt(a**2 - x1**2)
    if y1.is_integer():
        y1 = round(y1)
        g = math.gcd(x1, y1)
        xv, yv = -1* (y1//g), x1//g
        r = b / (math.sqrt(xv**2 + yv**2))
        if r.is_integer():
            print("YES")
            print(0, 0)
            print(round(x1), round(y1))
            print(round(xv*r), round(yv*r))
            break
else:
    print("NO")
