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

# -*- coding: utf-8 -*-

from __future__ import division;
from bisect import *;
import sys;
from math import *;
from fractions import *;
from itertools import *;
import io;
import re;

INF = 987654321987654321987654321;

def readint(delimiter=' ') :
    return map(int, raw_input().split(delimiter));

def readstr(delimiter=' ') :
    return raw_input().split(delimiter);

def readfloat(delimiter=' ') :
    return map(float, raw_input().split(delimiter));

def index(a, x):
    'Locate the leftmost value exactly equal to x'
    i = bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    raise ValueError

def find_lt(a, x):
    'Find rightmost value less than x'
    i = bisect_left(a, x)
    if i:
        return a[i-1]
    raise ValueError

def find_le(a, x):
    'Find rightmost value less than or equal to x'
    i = bisect_right(a, x)
    if i:
        return a[i-1]
    raise ValueError

def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bisect_right(a, x)
    if i != len(a):
        return a[i]
    raise ValueError

def find_ge(a, x):
    'Find leftmost item greater than or equal to x'
    i = bisect_left(a, x)
    if i != len(a):
        return a[i]
    raise ValueError

def bin_search(a, x, left, right) :

    while left<=right :
        mid = (left + right)//2;

        if a[mid] == x :
            return mid;
        elif a[mid] < x :
            left = mid + 1;
        elif a[mid] > x :
            right = mid - 1;

        pass

    return -1;
    pass

def printf(format, *args):
    """Format args with the first argument as format string, and write.
    Return the last arg, or format itself if there are no args."""
    sys.stdout.write(str(format) % args)
    pass

if __name__ == '__main__':
    # Generate side #
    def get_sides(c) :
        arr_res = [];
        cpow = c**2;
        a_sol = -1;
        b_sol = -1;
        for a in xrange(1, c+1) :
            bpow = cpow - a**2;
            b = sqrt(bpow);
            if b != 0 and b % 1 == 0 :
                a_sol = int(a);
                b_sol = int(b);
                arr_res.append([a_sol, b_sol]);
                pass
            pass

        return arr_res;
        pass


    left, right = readint();
    left_arr = get_sides(left);
    right_arr = get_sides(right);
    has_answer = False;
    if (len(left_arr) == 0 or len(right_arr) == 0) :
        print "NO";
        pass
    else :
        for ii in xrange(len(left_arr)) :
            for jj in xrange(len(right_arr)) :
                left_now = left_arr[ii];
                right_now = right_arr[jj];
                left_a, left_b = sorted(left_now);
                right_a, right_b = sorted(right_now);

                # create perpendicular lines #
                grad_left = - left_a / left_b;
                grad_right = right_a / right_b;
                valid = True;
                if (grad_left * grad_right != -1) :
                    right_a, right_b = right_b, right_a;
                    grad_right = right_a / right_b;
                    if (grad_left * grad_right != -1) :
                        valid = False;
                    pass
                if (not valid) :
                    pass
                else :
                    #print grad_left * grad_right;
                    if left_a == right_a :
                        left_a, left_b = left_b, left_a;
                        right_a, right_b = right_b, right_a;
                    print "YES";
                    print -left_b, left_a;
                    print 0, 0;
                    print right_b, right_a;
                    has_answer = True;
                    pass
                if has_answer :
                    break;
                pass
            if has_answer :
                break;
                pass
            pass
        if not has_answer :
            print "NO";

    pass