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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.BitSet;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main (String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader (inputStream);
		PrintWriter out = new PrintWriter (outputStream);
		TaskA solver = new TaskA ();
		solver.solve (1, in, out);
		out.close ();
	}
	
	static class TaskA {
		private static long gcd (long a, long b) {
			if (a<b) {
				a = (a^b)^(b = a);
			}
			while (b != 0) {
				a = ((a %= b)^b)^(b = a); //using the fact that xor is left associative
			}
			return a;
		}
		
		public void solve (int testNumber, InputReader in, PrintWriter out) {
/* no 2 points can have equal abscissa or ordinate ==> a*a and b*b must be expressed as sum of 2 squares
 * The key point here is all the coordinate points must be int and obviously it must form a right triangle
 * How to express a number as sum of two squares? let's brute on first and check if c-first^2 is a square or not
 * But I have no efficient idea to find out the other point so had to see editorial for that, it was a nice one
 * If your previous found point is (x,y) then the slope for the perpendicular is -x/y (from -1/(y/x)), make it
 * simple by -(x/gcd(x,y))/(y/gcd(x,y)=-p/q(let) and then the required point must be -q*b/tmp,p*b/tmp where tmp is
 * distance from origin to p,q. As vertices must be int so b/tmp must be int && both point's y must be unique....*/
			int a = in.nextInt (), b = in.nextInt (), c, d, e, f;
			BitSet flg = new BitSet (1000005);
			for (int i = 0; i<1000; i++) {
				flg.set (i*i);
			}
			for (int i = 1; i<a; i++) {
				if (flg.get (a*a-i*i)) {
					c = i;
					d = (int) Math.round (Math.sqrt (a*a-i*i));
					int tmp = (int) gcd (c, d);
					int p = c/tmp, q = d/tmp;
					tmp = (int) Math.round (Math.sqrt (p*p+q*q));//c^2+d^2 is ... ==> p^2+q^2 is...
					e = -q*b/tmp;
					f = p*b/tmp;
					if (d != f && b%tmp == 0) {
						out.println ("YES\n0 0\n"+c+" "+d+"\n"+e+" "+f);
						return;
					}
				}
			}
			out.println ("NO");
		}
		
	}
	
	static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;
		
		public InputReader (InputStream stream) {
			reader = new BufferedReader (new InputStreamReader (stream), 32768);
			tokenizer = null;
		}
		
		public String next () {
			while (tokenizer == null || !tokenizer.hasMoreTokens ()) {
				try {
					String str;
					if ((str = reader.readLine ()) != null) tokenizer = new StringTokenizer (str);
					else return null;//to detect eof
				} catch (IOException e) {
					throw new RuntimeException (e);
				}
			}
			return tokenizer.nextToken ();
		}
		
		public int nextInt () {
			return Integer.parseInt (next ());
		}
		
	}
}

