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.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class Triangle {
	static int mod = 1000000007;

	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[10005]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}

	static int bs, ht;
	static int dp[][];

	public static void main(String[] args) throws IOException {
		Reader in = new Reader();
		int i, t, n, a, b;
		a = in.nextInt();
		b = in.nextInt();
		StringBuilder ans = new StringBuilder();
		for (int xa = 1; xa < a; ++xa) {
			int ya2 = a * a - xa * xa;
			int ya = (int) (Math.sqrt(ya2));
			if (ya * ya != ya2)
				continue;
			int xb = -ya * b;
			if (xb % a != 0)
				continue;
			xb /= a;
			int yb = xa * b;
			if (yb % a != 0)
				continue;
			yb /= a;
			if (xb == xa || yb == ya)
				continue;
			ans.append("YES\n");
			ans.append(0 + " " + 0 + "\n");
			ans.append(xa + " " + ya + "\n");
			ans.append(xb + " " + yb + "\n");
			System.out.println(ans);
			return;
		}
		System.out.println("NO");
//		System.out.println(Math.sqrt(a * a + b * b));
	}

	private static boolean isHypo(int req, int b, int h) {
		if (dp[b][h] == 1) {
			bs = b;
			ht = h;
			return true;
		} else if (dp[b][h] == 0)
			return false;

		int hypo = b * b + h * h;
//		System.out.println(b + " " + h);
		if (req * req == hypo) {
			bs = b;
			ht = h;
			dp[b][h] = 1;
			return true;
		} else if (req * req < hypo) {
			dp[b][h] = 0;
			return false;
		}
		dp[b][h] = 0;
		return isHypo(req, b + 1, h) || isHypo(req, b, h + 1);
	}
}
