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.
import sys
input = sys.stdin.readline


def f(x):
    s = set()
    for i in range(1, x):
        y = (x**2 - i**2)**0.5
        if y == int(y):
            s.add((i, int(y)))
    return s


a, b = map(int, input().split())
d = f(a)
q = f(b)
for i1, i2 in d:
    for i3, i4 in q:
        if i1*i4 == i2*i3:
            print('YES')
            print(0, 0)
            print(-i1, i2)
            print(i4, i3)
            exit()
print('NO')