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

import java.util.*;
import java.io.*;
public class A {
    public static long time = 0;
    public static void main(String[] args) throws Exception {
        time = System.currentTimeMillis();
        
        IN = System.in;
        OUT = System.out;
        in = new BufferedReader(new InputStreamReader(IN));
        out = new PrintWriter(OUT, FLUSH);
        solveOne();
        out.flush();
    }
    
    public static void solveOne() throws Exception {
        long[] sqr = new long[1000 + 1];
        for (int i = 0; i <= 1000; i++){
            sqr[i] = i * i;
        }
        int a = ni();
        int b = ni();
        long a2 = a * a;
        long b2 = b * b;
        boolean have = false;
        int[] p1 = {0,0};
        int[] p2 = {0,0};
        A:
        for (int x1 = 1; x1 < a; x1++){
            long x1sqr = x1 * x1;
            long y1sqr = a2 - x1sqr;
            long y1 = Arrays.binarySearch(sqr, y1sqr);
            if (y1 < 0) continue;
            for (int x2 = 1; x2 < b; x2++){
                long x2sqr = x2 * x2;
                long y2sqr = b2 - x2sqr;
                long y2 = Arrays.binarySearch(sqr, y2sqr);
                if (y2 < 0) continue;
                long left = x1sqr * x2sqr;
                long right = y1sqr * y2sqr;
                if (left == right) if (y1 != y2){
                    have = true;
                    p1[0] = -x1;
                    p2[0] = x2;
                    p1[1] = (int)y1;
                    p2[1] = (int)y2;
                    break A;
                }
            }
        }
        if (have){
            pn("YES");
            pn("0 0");
            pn(p1[0] + " " + p1[1]);
            pn(p2[0] + " " + p2[1]);
        }
        else {
            pn("NO");
        }
    }
    
    public static void solveTwo() throws Exception {
        
    }
    
    public static void solveThree() throws Exception {
        
    }
    
    public static BufferedReader in;
    public static StringTokenizer st;
    public static InputStream IN;
    public static OutputStream OUT;
    public static String nx() throws Exception {
        for (;st == null || !st.hasMoreTokens();){
            String k1 = in.readLine();
            if (k1 == null) return null;
            st = new StringTokenizer(k1);
        }
        return st.nextToken();
    }
    public static int ni () throws Exception {
        return Integer.parseInt(nx());
    }
    public static long nl() throws Exception{
        return Long.parseLong(nx());
    }
    public static double nd() throws Exception{
        return Double.parseDouble(nx());
    }
    public static void px(Object ... l1){
        System.out.println(Arrays.deepToString(l1));
    }
    public static boolean FLUSH = false;
    public static PrintWriter out;
    public static void p(Object ... l1){
        for (int i = 0; i < l1.length; i++){
            if (i != 0) out.print(' ');
            out.print(l1[i].toString());
        }
    }
    public static void pn(Object ... l1){
        for (int i = 0; i < l1.length; i++){
            if (i != 0) out.print(' ');
            out.print(l1[i].toString());
        }
        out.println();
    }
    
    public static void pn(Collection l1){
        boolean first = true;
        for (Object e: l1){
            if (first) first = false;
            else out.print(' ');
            out.print(e.toString());
        }
        out.println();
    }

}
