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.
a, b = map(int, input().split())
if a > b: a, b = b, a
u, q = 1, 'NO'
while 2 * u * u < a:
    v = sqrt(a - u * u)
    if v % 1 == 0:
        v = int(v)
        x, y = (v - u) * (u + v), 2 * v * u
        i, j = x * b / a, y * b / a
        if 0 == i % 1 == j % 1:
            i, j = int(i), int(j)
            q = 'YES\n' + str(x) + ' ' + str(y) + '\n0 0\n' + str(j) + ' ' + str(-i)
            break
    u += 1
print(q)