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=map(int,input().split())
xy1=[]
xy2=[]
for i in range(-1000,1001):
  for j in range(-1000,1001):
    if a**2==i**2+j**2:
      xy1.append([i,j])
    if b**2==i**2+j**2:
      xy2.append([i,j])
for x1,y1 in xy1:
  for x2,y2 in xy2:
    if 0 in set([x1,x2,y1,y2]):
      continue
    if x1*x2+y1*y2==0 and x1!=x2 and y1!=y2:
      print("YES")
      print(0,0)
      print(x1,y1)
      print(x2,y2)
      exit()
print("NO")