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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.StringTokenizer;

/**
 *
 *
 * @author pttrung
 */
public class C {

    //   public static long x, y, gcd;
    public static int Mod = 1000000007;
    public static PrintWriter out;
    public static int op = 0, maxIndex = 0;

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        out = new PrintWriter(System.out);
        //   System.out.println(Integer.MAX_VALUE);
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        int a = in.nextInt();
        int b = in.nextInt();
        boolean ok = false;
        for (int i = 1; i <= a && !ok; i++) {
            int c = cal(a, i);
            if (c > 0) {
                // System.out.println(i + " " + c);
                for (int j = 1; j <= b; j++) {
                    int d = cal(b, j);
                    if (d > 0) {
                        Point p = new Point(-i, c);
                        Point q = new Point(j, d);
                        if (dist(p, q) == a * a + b * b && p.y != q.y) {
                            ok = true;
                            out.println("YES");
                            out.println(p.x + " " + p.y);
                            out.println(0 + " " + 0);
                            out.println(q.x + " " + q.y);
                            break;
                        }
                        p = new Point(-c, i);
                        if (dist(p, q) == a * a + b * b && p.y != q.y) {
                            ok = true;
                            out.println("YES");
                            out.println(p.x + " " + p.y);
                            out.println(0 + " " + 0);
                            out.println(q.x + " " + q.y);
                            break;
                        }
                        q = new Point(d, j);
                        if (dist(p, q) == a * a + b * b && p.y != q.y) {
                            ok = true;
                            out.println("YES");
                            out.println(p.x + " " + p.y);
                            out.println(0 + " " + 0);
                            out.println(q.x + " " + q.y);
                            break;
                        }
                        p = new Point(-i, c);
                        if (dist(p, q) == a * a + b * b && p.y != q.y) {
                            ok = true;
                            out.println("YES");
                            out.println(p.x + " " + p.y);
                            out.println(0 + " " + 0);
                            out.println(q.x + " " + q.y);
                            break;
                        }
                    }
                }
            }
        }
        if (!ok) {
            out.println("NO");
        }
        out.close();
    }

    public static int cal(int a, int b) {
        int val = a * a - b * b;
        for (int i = 1; i * i <= val; i++) {
            if (i * i == val) {
                return i;
            }
        }
        return -1;
    }

    public static int dist(Point a, Point b) {
        return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
    }

    public static Point clock(Point p, int n, int m) {
        Point result = new Point(p.y, n - p.x + 1);
        return result;
    }

    public static Point anti_clock(Point p, int n, int m) {
        Point result = new Point(m - p.y + 1, p.x);
        return result;
    }

    public static int cross(Point a, Point b) {
        int val = a.x * b.y - a.y * b.x;
        return val;
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);


    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Point o) {
            if (x != o.x) {
                return x - o.x;
            } else {
                return y - o.y;
            }
        }
    }
//    public static void extendEuclid(long a, long b) {
//        if (b == 0) {
//            x = 1;
//            y = 0;
//            gcd = a;
//            return;
//        }
//        extendEuclid(b, a % b);
//        long x1 = y;
//        long y1 = x - (a / b) * y;
//        x = x1;
//        y = y1;
//
//    }

    public static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        public void update(int index, int value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public int get(int index) {
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}
