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.
def main():
    from math import sqrt, hypot
    a, b = map(float, input().split())
    if a > b:
        a, b = b, a
    aa = a * a
    for u in range(1, 1000):
        v = sqrt(aa - u * u)
        if u > v:
            print("NO")
            return
        if v.is_integer():
            x, y = b * u / a, b * v / a
            if x.is_integer() and y.is_integer():
                print("YES\n0 0\n{:0.0f} {:0.0f}\n{:0.0f} -{:0.0f}".format(v, u, x, y))
                return


if __name__ == '__main__':
    main()
