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.*;

public class C {
    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;
    int b;
    final double eps = 0.00001;
    final double pi = 3.141592653;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

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

    long[] check(int x, int y) {
        double phi = Math.atan2((double)y, (double)x);
        double newphi1 = phi + pi / 2;
        double newphi2 = phi - pi / 2;
        double newmod = (double)b;
        double x1 = newmod * Math.cos(newphi1);
        double y1 = newmod * Math.sin(newphi1);
        if (Math.abs(x1 - Math.round(x1)) < eps && Math.abs(y1 - Math.round(y1)) < eps) {
            long[] res = new long[2];
            res[0] = Math.round(x1);
            res[1] = Math.round(y1);
            return res;
        } else {
            double x2 = newmod * Math.cos(newphi1);
            double y2 = newmod * Math.sin(newphi1);
            if (Math.abs(x2 - Math.round(x2)) < eps && Math.abs(y2 - Math.round(y2)) < eps) {
                long[] res = new long[2];
                res[0] = Math.round(x1);
                res[1] = Math.round(y1);
                return res;
            } else {
                long[] res = new long[2];
                res[0] = Long.MAX_VALUE;
                return res;
            }
        }
    }

    public void solve() throws IOException {
        int a = nextInt();
        b = nextInt();
        for (int i = -a; i < a + 1; i++) {
            for (int j = -a; j < a + 1; j++) {
                if (i != 0 && j != 0 && i * i + j * j == a * a) {
                    long[] res = check(i, j);
                    if (res[0] != Long.MAX_VALUE) {
                        if (i != 0 && res[0] != i && res[0] != 0 && j != 0 && res[1] != j && res[1] != 0)        {
                            out.println("YES");
                            out.println(0 + " " + 0);
                            out.println(i + " " + j);
                            out.println(res[0] + " " + res[1]);
                            out.flush();
                            System.exit(0);
                        }
                    }
                }
            }
        }
        out.println("NO");
    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

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