408_C. Triangle
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.

Input

The first line contains two integers a, b (1 ≤ a, b ≤ 1000), separated by a single space.

Output

In the first line print either "YES" or "NO" (without the quotes) depending on whether the required location exists. If it does, print in the next three lines three pairs of integers — the coordinates of the triangle vertices, one pair per line. The coordinates must be integers, not exceeding 109 in their absolute value.

Examples

Input

1 1


Output

NO


Input

5 5


Output

YES
2 1
5 5
-2 4


Input

5 10


Output

YES
-10 4
-2 -2
1 2
```python
def pitagoras(k):
    casos_possiveis = []
    for n in range(1,k):
        m = int((k**2 - n**2)**(0.5))
        if((n**2 + m**2) == k**2):
            casos_possiveis.append([n, m])
    return casos_possiveis

def possivelRepresntar(k):
    for n in range(1, k):
        m = int((k**2 - n**2)**(0.5))
        if ((n ** 2 + m ** 2) == k ** 2):
            return True

def tangentes(v):
    tangentes = []
    for p in v:
        tangente = p[0]/p[1]
        tangentes.append(tangente)
    return tangentes

def vetorSemRepeticao(v1, v2):
    v = []
    v3 = v1 + v2
    for p in v3:
        if(p not in v):
            v.append(p)
    return v


def vetorUtil(v1, v2):
    v_util = []
    v3 = vetorSemRepeticao(v1,v2)
    for vx in v3:
        if(vx in v1 and vx in v2):
            v_util.append(vx)
    return v_util

def td_diferente(a,b,c,x,y,z):
    if(a!=b and a!=c and b!=c and x!=y and x!=z and y!=z):
        return True
    else:
        return False

a , b  = input().split()

a = int(a)
b = int(b)

deu_certo = False
e3 = 0
e4 = 0
e5 = 0

if(possivelRepresntar(a) and possivelRepresntar(b)):
    p1 = pitagoras(a)
    p2 = pitagoras(b)

    t1 = tangentes(pitagoras(a))
    t2 = tangentes(pitagoras(b))

    t_util = vetorUtil(t1, t2)

    if(len(t_util) != 0):

        for case in t_util:
            caso = case

            e1 = p1[(t1.index(caso))]
            e2 = p2[(t2.index(1/caso))]
            e4 = [0 ,e1[0]]
            e5 = [e1[1],0]
            e3 = [e1[1]+e2[1], e2[0]]

            if(td_diferente(e3[0],e4[0],e5[0],e3[1],e4[1],e5[1])):
                deu_certo = True
                print("YES")
                print("{} {}".format(e3[0], e3[1]))
                print("{} {}".format(e4[0], e4[1]))
                print("{} {}".format(e5[0], e5[1]))
                break
        if(not deu_certo):
            print("NO")
    else:
        print("NO")
else:
    print("NO")
```