#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) != EOF) {
    int flag = 1;
    if (b > a) {
      int t;
      t = a;
      a = b;
      b = t;
    }
    int c = gcd(a, b);
    int i = 0, j = 0;
    for (i = 3; i < c && flag == 1; i++)
      for (j = 3; j < c && flag == 1; j++) {
        if (i * i + j * j == c * c) flag = 2;
      }
    j--;
    i--;
    if (flag == 2) {
      printf("YES\n");
      printf("0 0\n");
      printf("%d %d\n", i * (a / c), j * (a / c));
      printf("%d %d\n", -j * (b / c), i * (b / c));
    }
    if (flag == 1) printf("NO\n");
  }
  return 0;
}
