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.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.Scanner;

public class C239 {

	public class solution {
		int x1;
		int y1;
		int x2;
		int y2;
		int x3;
		int y3;

		public solution() {
			x1 = x2 = y1 = y2 = x3 = y3 = 0;
		}

	}

	static boolean perfect(int num) {

		double s = Math.sqrt(num);
		int ss = (int) s;
		if (ss * ss == num)
			return true;
		else
			return false;

	}

	public void run() {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();

		ArrayList<Integer> x = new ArrayList<Integer>();
		ArrayList<Integer> y = new ArrayList<Integer>();

		for (int xx = 0 - a-a; xx <= a+a; xx++) {

			int inter = a * a - xx * xx;

			if (!perfect(inter) || xx == 0)
				continue;

			int sq = (int) Math.sqrt(inter);

			int y1 = sq;
			int y2 = -sq;

			if (y1 != 0) {
				x.add(xx);
				y.add(y1);
			}

			if (y2 != 0) {
				x.add(xx);
				y.add(y2);
			}

		}

		ArrayList<solution> all = new ArrayList<solution>();
		for (int i = 0; i < x.size(); i++) {
			int xnow = x.get(i);
			int ynow = y.get(i);

			for (int xx = xnow - b-b; xx <= xnow + b+b; xx++) {

				int inter = b * b - (xnow - xx) * (xnow - xx);

				if (!perfect(inter))
					continue;

				int sq = (int) Math.sqrt(inter);

				int yy1 = ynow - sq;

				if ((yy1 - ynow) * ynow == -xnow * (xx - xnow) && yy1 != 0) {
					solution newsol = new solution();
					newsol.x1 = 0;
					newsol.y1 = 0;
					newsol.x2 = xnow;
					newsol.y2 = ynow;
					newsol.x3 = xx;
					newsol.y3 = yy1;

					all.add(newsol);

				}
				int yy2 = sq + ynow;
				if ((yy2 - ynow) * ynow == -xnow * (xx - xnow) && yy2 !=0) {
					solution newsol = new solution();
					newsol.x1 = 0;
					newsol.y1 = 0;
					newsol.x2 = xnow;
					newsol.y2 = ynow;
					newsol.x3 = xx;
					newsol.y3 = yy2;

					all.add(newsol);

				}

			}

		}

		if (all.size() == 0)
			System.out.println("NO");
		else {

			System.out.println("YES");
			solution here = all.get(0);
			System.out.println(here.x1 + " " + here.y1);
			System.out.println(here.x2 + " " + here.y2);
			System.out.println(here.x3 + " " + here.y3);

		}

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new C239().run();

	}

}
