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())
x1,y1=0,0
for i in range(1,1001):
  for j in range(i+1,1001):
    if a**2==i**2+j**2 and x1==0:
      x1,y1=i,j
x2,y2=-10**18,-10**18
for i in range(-1000,1001):
  if i==0:
    continue
  for j in range(-1000,1001):
    if j==0:
      continue
    if b**2==i**2+j**2 and i*x1+j*y1==0 and x2==-10**18 and (not x1==i or y1==j):
      x2,y2=i,j
if x1>0 and x2!=-10**18:
  print("YES")
  print(0,0)
  print(x1,y1)
  print(x2,y2)
else:
  print("NO")