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.
s=[-1]
for i in range(1,1001):
    pd=0
    for j in range(1,i):
        zc=i**2-j**2
        dq=int(zc**0.5)
        if(dq**2==zc and dq>0):
            pd=1
            s.append([j,dq])
            break
    if(pd==0):
        s.append(-1)
a,b=map(int,input().split())
if(s[a]==-1 or s[b]==-1):
    print("NO")
else:
    x=-s[a][0];y=-s[a][1]
    zcx=x;zcy=y
    x+=s[b][0];y+=s[b][1]
    if(y!=0):
        print("YES")
        print("%d %d" %(zcx,zcy))
        print("%d %d" %(x,y))
    else:
        x=-s[a][1];y=-s[a][0]
        zcx=x;zcy=y
        x+=s[b][0];y+=s[b][1]
        if(y!=0):
            print("YES")
            print("%d %d" %(zcx,zcy))
            print("%d %d" %(x,y))
        else:
            x=-s[a][0];y=-s[a][1]
            zcx=x;zcy=y
            x+=s[b][1];y+=s[b][0]
            if(y!=0):
                print("YES")
                print("%d %d" %(zcx,zcy))
                print("%d %d" %(x,y))
            else:
                x=-s[a][1];y=-s[a][0]
                zcx=x;zcy=y
                x+=s[b][1];y+=s[b][0]
                if(y!=0):
                    print("YES")
                    print("%d %d" %(zcx,zcy))
                    print("%d %d" %(x,y))
                else: print("NO")