#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  int x1, y1, x2, y2, f;
  while (~scanf("%d%d", &a, &b)) {
    for (x1 = 1, f = 0; x1 < a; x1++) {
      y1 = sqrt(a * a - x1 * x1);
      if (a * a == x1 * x1 + y1 * y1) {
        x2 = y1 * b / a;
        y2 = x1 * b / a;
        if (b * b == x2 * x2 + y2 * y2 && y1 != y2) {
          printf("YES\n");
          printf("%d %d\n", 0, 0);
          printf("%d %d\n", x1, y1);
          printf("%d %d\n", -x2, y2);
          f = 1;
          break;
        }
      }
    }
    if (f == 0) printf("NO\n");
  }
}
