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.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;
 
public class solver implements Runnable {
        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()){
                        try{
                                tok = new StringTokenizer(in.readLine());
                        }catch (Exception e){
                                return null;
                        }
                }
                return tok.nextToken();
        }
        String readString(String delim) throws IOException{
            while(!tok.hasMoreTokens()){
                    try{
                            tok = new StringTokenizer(in.readLine());
                    }catch (Exception e){
                            return null;
                    }
            }
            return tok.nextToken(delim);
    }
       
        int readInt() throws IOException{
                return Integer.parseInt(readString());
        } 
        int readInt(String delim) throws IOException{
            return Integer.parseInt(readString(delim));
        } 
        long readLong() throws IOException{
                return Long.parseLong(readString());
        }  
        long readLong(String delim) throws IOException{
            return Long.parseLong(readString(delim));
        }      
        double readDouble() throws IOException{
                return Double.parseDouble(readString());
        }      
        double readDouble(String delim) throws IOException{
            return Double.parseDouble(readString(delim));
        } 
        char readChar() throws IOException {
            char val = 0;
            do{
                val = (char) in.read();
            }while(val == '\n' || val == '\r');
            return val;
        }
        char readChar(String skipChars)throws IOException{
            char val = 0;
            boolean ret;
            do{
                val = (char) in.read();
                ret = false;
                for (int i = skipChars.length()-1; i >= 0; i--){
                    if (skipChars.charAt(i) == val){
                        ret = true;
                        break;
                    }
                }
            }while(ret);
            return val;
        }
        
        public class Pair<T1,T2> {
            public T1 x1;
            public T2 x2;
            public Pair(){};
            public Pair(T1 x1, T2 x2){
                this.x1 = x1;
                this.x2 = x2;
            }
            public String toString(){
                return x1.toString() + " " + x2.toString();
            }
        }
        public class Point implements Comparable<Point>{
            public int x1, x2;
            public Point(){}
            public Point(int a, int b){x1 = a;x2=b;}
            public int compareTo(Point o) {
                return x1-o.x1;
            }
            public String toString(){
                return x1 + " " + x2;
            }
        }
 //----------------------------------------        
        
        Point getPif(int a, int i){
            int aa  = a*a;
            int ii;
            for (;i*i + 1 <= aa ;i++){
                ii = i*i;
                int cc = aa - ii;
                int c = (int) Math.sqrt(cc);
                cc=c*c;
                
                if (cc + ii == aa){
                    return new Point(i,c);
                }
            }
            return null;
        }
                
        public void solve() throws IOException {
            int a = readInt();
            int b = readInt();
            
            int mm;
            if (b < a){
                mm = b;
                b = a;
                a = mm;
            }
            
            int i = 0;
            
            int aa = a*a;
            int bb = b*b;
            int ii, kk, zz;
            while(true){
                
                Point p = getPif(b, i+1);
                if (p == null){
                    break;
                }
                
                i = p.x1;
                ii = i*i;
                int k = p.x2;
                kk = k*k;
                
                int z = (int) (a*k/Math.sqrt(ii+kk));
                zz = z*z;
                if (aa*kk != zz*(ii+kk)){
                    continue;
                }
                
                int m = (int) Math.sqrt(aa - zz);
                mm = m*m;
                if (mm + zz != aa) continue;
                if (m == k) continue;
                
                out.println("YES");
                out.println("0 " + i);
                out.println(k +" 0");
                out.println((m) +" " + (i+z));
                return;
            }
            out.print("NO");
        }
        
        
//----------------------------------------
        public static void main(String[] args){
                new Thread(null, new solver(), "", 256 * (1L << 20)).start();
        }
       
        long timeBegin, timeEnd;
 
        void time(){
                timeEnd = System.currentTimeMillis();
                System.err.println("Time = " + (timeEnd - timeBegin));
        }
       
        public void run(){
                try{
                        timeBegin = System.currentTimeMillis();
                        init();
                        solve();
                        out.close();
                        time();
                }catch (Exception e){
                        e.printStackTrace(System.err);
                        System.exit(-1);
                }
        }
}