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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;

public class A {
	FastScanner in = new FastScanner(System.in);
	PrintWriter out = new PrintWriter(System.out);

	ArrayList<Integer[]> aPoint = new ArrayList<Integer[]>();
	ArrayList<Integer[]> bPoint = new ArrayList<Integer[]>();
	
	
	void culPoint(int x, ArrayList<Integer[]> list) {
		for (int i = 1; i < x; i++) {
			for (int j = 1; j < x; j++) {
				if (i*i + j*j == x*x) {
					list.add(new Integer[]{i, j});
					list.add(new Integer[]{-i, j});
					list.add(new Integer[]{i, -j});
					list.add(new Integer[]{-i, -j});					
				}
			}
		}		
	}
	
	int getDistance(Integer[] p) {
		return p[0] * p[0] + p[1] * p[1];
	}
	
	int getDistance(Integer[] p1, Integer[] p2) {
		int x = p1[0] - p2[0];
		int y = p1[1] - p2[1];
		return x * x + y * y;
	}
	
	public void run() {
		int a = in.nextInt(), b = in.nextInt();
		
		Integer[][] res = new Integer[3][2];
		
		res[0][0] = 0;
		res[0][1] = 0;
		res[1][0] = -1;
		res[2][0] = -1;
		
		culPoint(a, aPoint);
		culPoint(b, bPoint);
		
		loop : for (Integer[] pa : aPoint) {
			
			
			for (Integer[] pb : bPoint) {
				if (pa[0].intValue() == pb[0].intValue()) continue;
				if (pa[1].intValue() == pb[1].intValue()) continue;

				int distA = getDistance(pa);
				int distB = getDistance(pb);
				int distC = getDistance(pa, pb);
				
				if (distA + distB == distC) {
					res[1] = pa;
					res[2] = pb;
					break loop;
				}
				System.out.println();
			}
		}
		
		if (res[1][0] == -1 || res[2][0] == -1)
			System.out.println("NO");
		else {
			System.out.println("YES");
			for (int i = 0; i < res.length; i++) {
				System.out.println(res[i][0] + " " + res[i][1]);
			}
		}
	}

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

	class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
			//stream = new FileInputStream(new File("dec.in"));

		}

		int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

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

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

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

		String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}
}

