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

a, b =map(int, input().split())
for x1 in range(1, a):
    if x1 ** 2 > a ** 2:
        break
    y1 = round((a ** 2 - x1 ** 2) ** 0.5)
    if x1 ** 2 + y1 ** 2 != a ** 2:
        continue
    x2, y2 = round(-y1 * b / a), round(x1 * b / a)
    if x2 ** 2 + y2 ** 2 == b ** 2:
        print('YES')
        print('0 0')
        print(x1, y1)
        print(x2, y2)
        sys.exit()
print('NO')
    
    