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 Main {
    public static IOS ios;
    public static void main(String[] args) throws Exception {
        ios = new IOS("","");
        (new Main()).run();
        ios.close();
    }
    public void run() throws Exception {
        Reader();
        Runner();
    }

    int a, b;
    public void Reader() throws Exception {
        ios.getToken();
        a = ios.getInt();
        b = ios.getInt();
    }

    int[] c = new int[1001001];
    ArrayList<Pal> u = new ArrayList<>(), v = new ArrayList<>();
    public void Runner() throws Exception {
        for (int i = 0; i <= 1000; ++i) {
            c[i * i] = i + 1;
        }
        for (int i = 0; i <= a; ++i) {
            if (c[a * a - i * i] > 0) {
                u.add(new Pal(i, c[a * a - i * i] - 1));
                u.add(new Pal(-i, c[a * a - i * i] - 1));
                u.add(new Pal(i, 1 - c[a * a - i * i]));
                u.add(new Pal(-i, 1 - c[a * a - i * i]));
            }
        }
        for (int i = 0; i <= b; ++i) {
            if (c[b * b - i * i] > 0) {
                v.add(new Pal(i, c[b * b - i * i] - 1));
                v.add(new Pal(-i, c[b * b - i * i] - 1));
                v.add(new Pal(i, 1 - c[b * b - i * i]));
                v.add(new Pal(-i, 1 - c[b * b - i * i]));
            }
        }
        for (Pal A: u) {
            for (Pal B: v) {
                if (A.x != 0 && A.y != 0 && B.x != 0 && B.y != 0 && A.x != B.x && A.y != B.y && A.x * B.x + A.y * B.y == 0) {
                    ios.write("YES\n0 0\n");
                    ios.write(A.x + " " + A.y + "\n");
                    ios.write(B.x + " " + B.y + "\n");
                    return;
                }
            }
        }
        ios.write("NO\n");
    }
    class Pal {
        public int x, y;
        Pal(int _x, int _y) {
            x = _x;
            y = _y;
        }
    }

}

class IOS {
    BufferedReader Reader;
    BufferedWriter Writer;
    public IOS(String inp, String out) throws Exception {
        Reader = new BufferedReader((inp == "")? (new InputStreamReader(System.in)): (new FileReader(inp)));
        Writer = new BufferedWriter((out == "")? (new OutputStreamWriter(System.out)): (new FileWriter(out)));
    }
    public void close() throws Exception {
        Writer.flush();
        if (Reader != null) Reader.close();
        if (Writer != null) Writer.close();
    }

    public String getLine() throws Exception {
        return Reader.readLine();
    }

    StringTokenizer Token;
    public void getToken() throws Exception {
        Token = new StringTokenizer(getLine());
    }

    public int getInt() throws Exception {
        return Integer.parseInt(Token.nextToken());
    }
    public long getLong() throws Exception {
        return Long.parseLong(Token.nextToken());
    }

    public void write(String mess) throws Exception {
        Writer.write(mess);
    }
}

