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

public class C1 
{
    FastScanner in;
    PrintWriter out;
    
    public int gcd(int a, int b) 
    {
        while (b !=0) 
        {
            int tmp = a % b;
            a = b;
            b = tmp;
        }
        
        return a;
       
      
    }

    public void solve() throws IOException 
    {
        int a = in.nextInt();
        int b = in.nextInt();
        
        int a2     = a * a;
        int bFound = 0;
        
        for(int x = 1; x < a; x++)
        {
            double y = Math.sqrt(a2 - x * x);
            int    yf = (int)y; 
            
            if(y == yf)
            {
                int g  = gcd(x, yf);
                int bx = (int)(-y / g);
                int by = (int)(x / g);
                
                double bLen  = Math.sqrt(bx * bx + by * by);
                int    bLenF = (int)bLen;
                
                if(bLen == bLenF && b % bLenF == 0)
                {
                    int bxFound = (int)(-y / g * b / bLenF);
                    int byFound = (int)(x / g * b / bLenF);
                    
                    int cx = x - bxFound;
                    int cy = yf - byFound;
                    
                    if(cx != 0 && cy != 0)
                    {
                        bFound = 1;
                        out.println("YES");
                        out.println("" + 0 + " " + 0);
                        out.println("" + x + " " + yf);
                        out.println("" + bxFound + " " + byFound);
                        break;
                    }
                }
            }
        }
        
        if(bFound == 0)
        {
            out.print("NO");
        }
        
    }

    public void run() {
        try {
            //in  = new FastScanner(new File("sum.in"));
            //out = new PrintWriter(new File("sum.out"));
            
            in  = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        FastScanner() {
            
            br = new BufferedReader(new InputStreamReader(System.in));
        
        }

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                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());
        }
        
        int[] nextIntArray(int size) 
        {
            int[] array = new int[size];
            
            for (int i = 0; i < size; i++){
                array[i] = nextInt();
            }
            
            return array;
        }
        
        long[] nextLongArray(int size) 
        {
            long[] array = new long[size];
            
            for (int i = 0; i < size; i++){
                array[i] = nextLong();
            }
            
            return array;
        }
        
        BigInteger nextBigInteger() 
        {
            return new BigInteger(next());
        }
        
        Point nextIntPoint()
        {
            int x = nextInt();
            int y = nextInt();
            return new Point(x, y);
        }
        
        Point[] nextIntPointArray(int size)
        {
            Point[] array = new Point[size];
            
            for (int index = 0; index < size; ++index){
                array[index] = nextIntPoint();
            }
            
            return array;
        }
        
        List<Integer>[] readGraph(int vertexNumber, int edgeNumber, boolean undirected)
        {
            List<Integer>[] graph = new List[vertexNumber];
                    
            for (int index = 0; index < vertexNumber; ++index)
            {
                graph[index] = new ArrayList<Integer>();
            }
                    
            while (edgeNumber-- > 0)
            {
                int from = nextInt() - 1;
                int to   = nextInt() - 1;
                        
                graph[from].add(to);
                if(undirected)
                    graph[to].add(from);
            }
                    
            return graph;
        }
    }

    public static void main(String[] arg) 
    {
        new C1().run();
    }
}