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.util.StringTokenizer;

public class y {
        static final double EPS = 1e-9;
    public static void main(String [] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int min = Math.min(a,b);
        int max = Math.max(a,b);
        Point x = null;
        Point y = null;
        for(int i=1;i<=min;++i)
            for(int j = 1 ; j <= min ; ++j){
                Point p = new Point(i,j);
                if(i*i + j*j != min * min)
                    continue;
                //System.out.println(i+" "+j);
                Point q = getP(p , max);
                //System.out.println(q.x +" "+ q.y);
                if(intgr(q) && Math.abs(i-q.x) > EPS && Math.abs(j - q.y) > EPS){
                    x = p;
                    y = q;
                    break;
                }
            }
        if(x == null)
            System.out.println("NO");
        else{
            System.out.println("YES");
            System.out.println("0 0");
            System.out.println((int)Math.round(x.x)+" "+((int)Math.round(x.y + EPS)));
            System.out.println((int)Math.round(y.x + EPS)+" "+((int)Math.round(y.y + EPS)));
        }
    }
    static boolean intgr(Point p){
        double x = Math.abs(p.x);
        double y = Math.abs(p.y);
        return Math.abs(x - Math.floor(x + EPS)) < EPS && Math.abs(y - Math.floor(y + EPS)) < EPS;
    }
    public static Point getP(Point p , int dist){
        Point org = new Point(0,0);
        Point q = p.rotate(-Math.PI/2 , org);
        Vector v = new Vector(org,q);
        v = v.scale(dist/v.norm());
        return org.translate(v);
    }
    static class Point implements Comparable<Point> {


        double x, y;

        Point(double a, double b) {
            x = a;
            y = b;
        }

        public int compareTo(Point p) {
            if (Math.abs(x - p.x) > EPS) return x > p.x ? 1 : -1;
            if (Math.abs(y - p.y) > EPS) return y > p.y ? 1 : -1;
            return 0;
        }

        public double dist(Point p) {
            return Math.sqrt(sq(x - p.x) + sq(y - p.y));
        }

        static double sq(double x) {
            return x * x;
        }

        Point rotate(double angle) {
            double c = Math.cos(angle), s = Math.sin(angle);
            return new Point(x * c - y * s, x * s + y * c);
        }
        // for integer points and rotation by 90 (counterclockwise) : swap x and y, negate x

        Point rotate(double theta, Point p)            //rotate around p
        {
            Vector v = new Vector(p, new Point(0, 0));
            return translate(v).rotate(theta).translate(v.reverse());
        }

        Point translate(Vector v) {
            return new Point(x + v.x, y + v.y);
        }
    }
    static class Vector {

        double x, y;

        Vector(double a, double b) { x = a; y = b; }

        Vector(Point a, Point b) { this(b.x - a.x, b.y - a.y); }

        Vector scale(double s) { return new Vector(x * s, y * s); }              //s is a non-negative value

        double dot(Vector v) { return (x * v.x + y * v.y); }

        double cross(Vector v) { return x * v.y - y * v.x; }

        double norm2() { return x * x + y * y; }
        double norm() { return Math.sqrt(x * x + y * y); }

        Vector reverse() { return new Vector(-x, -y); }

        Vector normalize()
        {
            double d = Math.sqrt(norm2());
            return scale(1 / d);
        }
    }
        static class Scanner{
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public Scanner(String file) throws Exception {br = new BufferedReader(new FileReader(file));}
        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(3000);}
    }
}
