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.
'''input
10 15
'''
# practicing a skill right after sleep improves it a lot quickly
from sys import stdin, setrecursionlimit
import math


def check(num):
	return math.sqrt(num) == int(math.sqrt(num))

def pythagoreanTriplets():
	mydict = dict()
	for i in range(1, 1001):
		for j in range(1, 1001):
			num = i ** 2 + j ** 2
			if check(num):
				mydict[int(math.sqrt(num))] = str(i) + ' ' + str(j)
	return mydict

# main starts
mydict = pythagoreanTriplets()
a, b = list(map(int, stdin.readline().split()))
if a in mydict and b in mydict:
	print("YES")
	a_f, a_s = list(map(int, mydict[a].split()))
	b_f, b_s = list(map(int, mydict[b].split()))
	print(0, a_s)
	print(a_f, 0)
	if b_f/b_s == a_f/a_s:
		print(b_s, a_s + b_f)
	else:
		print(b_f, a_s + b_s)



else:
	print("NO")
