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
// Main Code at the Bottom
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger; 
public class Main {
	//Fast IO class
    static class FastReader {
        BufferedReader br; 
        StringTokenizer st; 
        public FastReader() {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) {
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
        int nextInt() {
            return Integer.parseInt(next()); 
        } 
        long nextLong() {
            return Long.parseLong(next()); 
        } 
        double nextDouble() {
            return Double.parseDouble(next()); 
        } 
        String nextLine() {
            String str = ""; 
            try {
                str = br.readLine(); 
            } 
            catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }     
    static long MOD=1000000000+7;
    //debug
    static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    // Pair
    static class pair{
    	long x,y;
    	pair(long a,long b){
    		this.x=a;
    		this.y=b;
    	}
    	public boolean equals(Object obj) {
    		if(obj == null || obj.getClass()!= this.getClass()) return false;
            pair p = (pair) obj;
            return (this.x==p.x && this.y==p.y);
        }
    	public int hashCode() {
            return Objects.hash(x,y);
        }
    }
    static FastReader sc=new FastReader();
    static PrintWriter out=new PrintWriter(System.out);  
    //Main function(The main code starts from here)
    static pair ans1=new pair(0,0),ans2=new pair(0,0);
    static boolean isPerfectSquare(int x) {
    	if(Math.floor(Math.sqrt(x))==Math.sqrt(x)) return true;
    	return false;
    }
    static boolean solve(int a,int b) {
    	for(int x1=1;x1<a;x1++) {
    		int y1_sq=a*a-x1*x1;
    		if(!isPerfectSquare(y1_sq)) continue;
    		int y1=(int)Math.sqrt(y1_sq);
    		for(int y2=1;y2<b;y2++) {
    			int x2_sq=b*b-y2*y2;
    			if(!isPerfectSquare(x2_sq)) continue;
    			int x2=-(int)Math.sqrt(x2_sq);
    			if(y1*y2+x1*x2!=0 || y1==y2) continue;
    			ans1=new pair(x1,y1);
    			ans2=new pair(x2,y2);
    			return true;
    		}
    	}
    	return false;
    }
    public static void main (String[] args) throws java.lang.Exception {
    	int test=1;
    	//test=sc.nextInt();
    	while(test-->0){
    		int a=sc.nextInt(),b=sc.nextInt();
    		solve(a,b);
    		if(solve(a,b) || solve(b,a)) {
    			out.println("YES");
    			out.println(0+" "+0);
    			out.println(ans1.x+" "+ans1.y);
    			out.println(ans2.x+" "+ans2.y);
    		}
    		else out.println("NO");
    		
    	}
        out.flush();
        out.close();
    }
}