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;

/**
 * Created by Vadim Semenov on 30-03-2014.
 */
public class TaskC implements Runnable {
    private Output solve(Input input) {
        for (int i = 1; i <= input.b; i++) {
            for (int j = 1; j < i; j++) {
                int k = i - j;
                int aa = input.a * input.a - j * j;
                int aaa = (int) Math.sqrt(aa);
                if (aaa * aaa != aa) continue;
                int bb = input.b * input.b - i * i;
                int bbb = (int) Math.sqrt(bb);
                if (bbb * bbb != bb) continue;
                if (k * k + (aaa + bbb) * (aaa + bbb) !=
                        input.a * input.a + input.b * input.b) continue;
                Output output = new Output();
                output.x1 = 0;
                output.y1 = k;
                output.x2 = aaa;
                output.y2 = i;
                output.x3 = aaa + bbb;
                output.y3 = 0;
                return output;
            }
        }
        Output output = new Output();
        output.x1 = Integer.MIN_VALUE;
        return output;
    }

    private Input read(InputReader in) {
        Input input = new Input();
        input.a = in.nextInt();
        input.b = in.nextInt();
        input.check();
        return input;
    }

    private void write(PrintWriter out, Output output) {
        if (output.x1 == Integer.MIN_VALUE) {
            out.println("NO");
        } else {
            out.println("YES");
            out.println(output.x1 + " " + output.y1);
            out.println(output.x2 + " " + output.y2);
            out.println(output.x3 + " " + output.y3);
        }
    }

    private static class Input {
        int a, b;
        void check() {
            if (a > 1000 || b > 1000) {
                throw new RuntimeException();
            }
            if (a > b) {
                int t = a;
                a = b;
                b = t;
            }
        }
    }

    private static class Output {
        int x1, x2, x3, y1, y2, y3;
    }

    @Override
    public void run() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        File inputFile = new File("taskc.in");
        File outputFile = new File("taskc.out");
        if (inputFile.exists() && inputFile.canRead()) {
            try {
                inputStream = new FileInputStream(inputFile);
                outputStream = new FileOutputStream(outputFile);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Input input = read(in);
        Output output = solve(input);
        write(out, output);
        in.close();
        out.close();
    }

    public static void main(String[] args) {
        new TaskC().run();
    }

    public static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

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

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

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

        public boolean hasNext() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String line = readLine();
                if (line == null) {
                    return false;
                }
                tokenizer = new StringTokenizer(line);
            }
            return true;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line = null;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return line;
        }

        public void close() {
            tokenizer = null;
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
