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 solv(a,b):
    n = max(a,b)
    D = {i*i:i for i in range(1,n)}
    L1 = []
    L2 = []
    aa = a*a
    bb = b*b
    for k in D:
        if aa-k in D:
            L1.append([D[k],D[aa-k]])
        if bb-k in D:
            L2.append([D[k],D[bb-k]])
    if not L1: return ["NO"]
    if not L2: return ["NO"]
    for a1,a2 in L1:
        for b1,b2 in L2:
            if a1*b2 == a2*b1:
                return ["YES","0 0","%s %s"%(a1,a2),"%s %s"%(-b2,b1)]
    return ["NO"]
  
a,b = map(int,input().split())
[print(s) for s in solv(a,b)]
