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_ = [int(i) for i in input().split(' ')]
a, b = input_[0], input_[1]
m1, m2 = min(a, b), max(a, b)
res = False
coordinates = []
for num in range(5, m1 + 1):
    if (m1 % num) != 0 and (m2 % num) != 0:
        continue
    for num1 in range(3, num):
        if abs((num ** 2 - num1 ** 2) ** (1/2) % 1) < 1e-7:
            num2 = int((num ** 2 - num1 ** 2) ** (1/2))
            x1, y1 = m1 // num * num1, m1 // num * num2
            x2, y2 = -1 * m2 // num * num2, m2 // num * num1
            if y1 != y2:
                res = True
                coordinates = [(x1, y1), (x2, y2)]
                break
    if len(coordinates) > 0:
        break
if res:
    print('YES')
    print('0 0')
    print(str(coordinates[0][0]), str(coordinates[0][1]))
    print(str(coordinates[1][0]), str(coordinates[1][1]))
else:
    print('NO')
