#include <bits/stdc++.h>
int check(int y, int x, int b) {
  float s, p, r, q;
  int a, b1;
  r = b * y / sqrt(x * x + y * y);
  q = floor(r);
  if (q == r) {
    s = (-1 * x * r) / y;
    q = floor(s);
    if (q == s) {
      a = (int)r;
      b1 = (int)s;
      if (x == r || s == y) {
        a *= -1;
        b1 *= -1;
      }
      printf("YES\n");
      printf("%d %d \n%d %d \n%d %d\n", 0, 0, x, y, a, b1);
      return (1);
    } else
      return (-1);
  }
  return (-1);
}
int main(void) {
  float a, b, i, k, y, p;
  scanf("%f %f", &a, &b);
  p = -1;
  for (i = 1; i < a; i++) {
    y = sqrt(a * a - i * i);
    k = floor(y);
    if (y == k) {
      p = check(y, i, b);
      if (p == 1) break;
    }
  }
  if (p == -1) printf("NO\n");
  return 0;
}
