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.
def isquare(n):
    h = n
    l = 1
    while h-l>1:
        m = (h+l)//2
        if m*m<=n:
            l = m
        elif m*m>n:
            h = m
    return l
a,b = map(int,input().split())
p,q,r,s = -1,-1,-1,-1
for i in range(3,a):
    if isquare(a*a-i*i)**2==a*a-i*i:
        p,q = i,isquare(a*a-i*i)
        break
for i in range(3,b):
    if isquare(b*b-i*i)**2==b*b-i*i:
        r,s = i,isquare(b*b-i*i)
        break
if p==-1 or q==-1 or r==-1 or s==-1:
    print("NO")
else:
    if p*r==q*s:
        print("YES\n",0,0,'\n',p,q,'\n',-r,s)
    elif p*s==q*r:
        print("YES\n",0,0,'\n',p,q,'\n',-s,r)
    else:
        print("NO")