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.util.*;
import java.util.Map.Entry;
import java.io.*;
import java.math.*;

import static java.util.Arrays.*;
import static java.lang.Math.*;
import static java.util.Collections.*;
import static java.lang.System.out;

public class Main {
	static boolean LOCAL = System.getSecurityManager() == null;
	Scanner in = new Scanner(System.in);

	void run() {
		int a = in.nextInt(), b = in.nextInt();
		int[][] A = work(a);
		if (!fit(A, a, b)) {
			out.println("NO");
		}
	}
	private boolean fit(int[][] as, int a, int b) {
		for (int[] A : as) {
			int g = gcd(A[0], A[1]);
			int r = a / g;
			if (b % r == 0) {
				int bt = b / r;
				if (A[0] / g * bt == A[1]) continue;
				out.println("YES");
				out.println("0 0");
				out.println(A[0] + " " + A[1]);
				out.println(-A[1] / g * bt + " " + A[0] / g * bt);
				return true;
			}
		}
		return false;
	}
	private int gcd(int i, int j) {
		while (j != 0) {
			int t = i;
			i = j;
			j = t % j;
		}
		if (i < 0) i = -i;
		return i;
	}
	private int[][] work(int a) {
		ArrayList<int[]> res = new ArrayList<int[]>();
		for (int i = 1; i < a; i++) {
			for (int j = 1; j < a; j++) {
				if (i * i + j * j == a * a) res.add(new int[] {i, j});
			}
		}
		return res.toArray(new int[0][]);
	}
	void debug(Object... os) {
		System.err.println(deepToString(os));
	}

	public static void main(String[] args) {
		if (LOCAL) {
			try {
				System.setIn(new FileInputStream("./../in"));
			} catch (IOException e) {
				LOCAL = false;
			}
		}
		new Main().run();
	}
}

class Scanner {
	BufferedReader br;
	StringTokenizer st;

	Scanner(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		eat("");
	}

	private void eat(String string) {
		st = new StringTokenizer(string);
	}

	String nextLine() {
		try {
			return br.readLine();
		} catch (IOException e) {
			return null;
		}
	}

	boolean hasNext() {
		while (!st.hasMoreTokens()) {
			String s = nextLine();
			if (s == null)
				return false;
			eat(s);
		}
		return true;
	}

	String next() {
		hasNext();
		return st.nextToken();
	}

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

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

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