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 = list(map(int,input().split()))
t = a*a
for x in range(-a,a+1):
    y = t-(x**2)
    z = int(y**0.5)
    if z*z==y:
        y = z
        # print(x,y)
        if x!=0 and y!=0:
            den = x**2 + y**2
            num = b*y
            z = int(den**0.5)
            if z*z==den:
                den = z
                if num%den==0:
                    x1 = num//den
                    num = x*x1
                    den = y
                    if num%den==0:
                        y1 = num//den
                        y1 = -y1
                        print("YES")
                        print(x,y)
                        print(x1,y1)
                        print(0,0)
                        exit()
        y = -z
        if x!=0 and y!=0:
            den = x**2 + y**2
            num = b*y
            z = int(den**0.5)
            if z*z==den:
                if num%den==0:
                    x1 = num//den
                    num = x*x1
                    den = y
                    if num%den==0:
                        y1 = num//den
                        y1 = -y1
                        print("YES")
                        print(x,y)
                        print(x1,y1)
                        print(0,0)
                        exit()
print("NO")
