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.
x=str(input())
def find(a):
    l=[]
    for i in range(1,a):
        for j in range(1,a):
            if((i**2+j**2)==a**2):
                l.append([i,j])
                l.append([-i,j])
                l.append([i,-j])
                l.append([-i,-j])
    return l

b=[]
l=[]
fi=[]
ri8=0
b=x.split(' ')
l=[y for y in b if y!='']
fi.append(int(l[0]))
fi.append(int(l[1]))
d=[]
e=[]
if(find(fi[0])!=d):
    d=find(fi[0])
if(find(fi[1])!=e):
    e=find(fi[1])
for i in range(len(d)):
    for j in range(len(e)):
        if((d[i][0]*e[j][0]+d[i][1]*e[j][1])==0):
            print("YES")
            print(0,0)
            print(d[i][0],d[i][1])
            print(e[j][0],e[j][1])
            ri8=1
        if(ri8==1):
            break
    if(ri8==1):
        break
    
if(ri8!=1):
    print("NO")