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.
#!/usr/bin/python3 -SOO
from math import sqrt
a,b = map(int,input().strip().split())
for i in range(1,a):
    x = a*a - i*i
    if x<=0 or int(sqrt(x) + 0.5)**2 != x: continue
    u = b*i/a
    v = b*sqrt(x)/a
    if abs(u-int(u)) < 0.0005 and abs(v-int(v)) < 0.0005 and int(u):
        print('YES')
        print('0 0')
        print('%d %d'%(-int(u),int(v)))
        print('%d %d'%(int(sqrt(x)),i))
        break
else:
    print('NO')
