#include <bits/stdc++.h>
using namespace std;
int a, b;
int gcd(int x, int y) { return x % y == 0 ? y : gcd(y, x % y); }
int main() {
  scanf("%d%d", &a, &b);
  if (a > b) {
    int t = a;
    a = b;
    b = t;
  }
  int g = gcd(a, b);
  for (int i = 1; 2 * i * i <= g * g; ++i) {
    int res = g * g - i * i;
    int r = sqrt(res);
    if (r * r == res) {
      if (r * a != i * b)
        printf("YES\n0 0\n%d %d\n%d %d\n", i * (a / g), r * (a / g),
               -r * (b / g), i * (b / g));
      else
        printf("YES\n0 0\n%d %d\n%d %d\n", r * (a / g), i * (a / g),
               -i * (b / g), r * (b / g));
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
