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.awt.Point;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;


import static java.lang.Math.*;

public class Main {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
    	if (ONLINE_JUDGE) {
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
    	} else {
    	in = new BufferedReader(new FileReader("input.txt"));
    	out = new PrintWriter("output.txt");
    	}
    	}

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) {
        new Main().run();
        // Sworn to fight and die
    }

    public static void mergeSort(int[] a) {
        mergeSort(a, 0, a.length - 1);
    }

    private static void mergeSort(int[] a, int levtIndex, int rightIndex) {
        final int MAGIC_VALUE = 50;
        if (levtIndex < rightIndex) {
            if (rightIndex - levtIndex <= MAGIC_VALUE) {
                insertionSort(a, levtIndex, rightIndex);
            } else {
                int middleIndex = (levtIndex + rightIndex) / 2;
                mergeSort(a, levtIndex, middleIndex);
                mergeSort(a, middleIndex + 1, rightIndex);
                merge(a, levtIndex, middleIndex, rightIndex);
            }
        }
    }

    private static void merge(int[] a, int levtIndex, int middleIndex,
            int rightIndex) {
        int length1 = middleIndex - levtIndex + 1;
        int length2 = rightIndex - middleIndex;
        int[] levtArray = new int[length1];
        int[] rightArray = new int[length2];
        System.arraycopy(a, levtIndex, levtArray, 0, length1);
        System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
        for (int k = levtIndex, i = 0, j = 0; k <= rightIndex; k++) {
            if (i == length1) {
                a[k] = rightArray[j++];
            } else if (j == length2) {
                a[k] = levtArray[i++];
            } else {
                a[k] = levtArray[i] <= rightArray[j] ? levtArray[i++]
                        : rightArray[j++];
            }
        }
    }

    private static void insertionSort(int[] a, int levtIndex, int rightIndex) {
        for (int i = levtIndex + 1; i <= rightIndex; i++) {
            int current = a[i];
            int j = i - 1;
            while (j >= levtIndex && a[j] > current) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = current;
        }
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    class LOL implements Comparable<LOL> {
    	 int x;
    	 
        
       

        @Override
        public int compareTo(LOL o) {

            
            return x - o.x; // ---->
            // return o.x - x; // <----
            // return o.y-y;
        }
        
        public void setX(int u) {
        	this.x=u;
        }

    }
    
    public int gcd(int a, int b) {
    	if (a%b==0) return b;
    	else return gcd(b,a%b);
    }
    
     public int min(int a,int b) {
    	 if (a>b) return b;
    	 else return a;
     }
    public void solve() throws IOException {
    	
    	int a=readInt();
    	int b=readInt();
    	int x1=0,y1=0,x2=0,y2=0;
    	
    	int tmp = a;
    	if (a>b) {
    		a=b;
    		b=tmp;
    	}

    	for (int i=1; i<a; i++) 
    		for (int j=1; j<a; j++) {
    			if (i*i+j*j==a*a) {
    				x1=j; y1=i; 
    		
    		if ((b*gcd(x1,y1))%a==0) {
    			x2= - (y1* b)/a;
    			y2 = (x1 * b)/a;
    			
    			if (y1==y2) {
    				 tmp=x1;
    				x1=y1;
    				y1=tmp;
    				tmp=x2;
    				x2=-y2;
    				y2=-tmp;
    			}
    			i=a; j=a;
    		}
    			
    		
    	
    			}
    		}
    	
    	if (x2==0) out.print("NO");
    	else {
    		out.println("YES");
    		out.println("0 0");
    		out.println(x1+ " "+ y1);
    		out.println(x2+ " "+ y2);
    	}
    	
    	
    			
    	}
        			
}