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()))
f=0
x1,y1,x2,y2=0,0,0,0
for x in range(-a,a+1):
    for y in range(-a,a+1):
        if (x**2+y**2==a**2) and (x!=0 and y!=0):
            m=y/x
            if float(int(b/(1+m**2)**(0.5)))==b/(1+m**2)**(0.5) and float(int((b*m)/(1+m**2)**(0.5)))==(b*m)/(1+m**2)**(0.5):
                x1=x
                y1=y
                x2=int(b/(1+m**2)**(0.5))
                y2=int((b*m)/(1+m**2)**(0.5))
                f=1
                break
    if f:
        break
if f:
    print('YES')
    print(0,0)
    print(x1,y1)
    print(x2,y2)
else:
    print('NO')