#include <bits/stdc++.h>
using namespace std;
int x, y;
void solve(void) {
  if (x > y) swap(x, y);
  for (int a = (1); a <= (x - 1); a++) {
    for (int b = (1); b <= (x - 1); b++) {
      if (a * a + b * b == x * x) {
        if ((y * b % x == 0) && (y * a % x) == 0) {
          int bp = y * b / x, ap = y * a / x;
          if (b != ap) {
            printf("YES\n%d %d\n0 0\n%d %d\n", -a, b, bp, ap);
            return;
          }
        }
      }
    }
  }
  printf("NO\n");
}
int main(void) {
  while (2 == scanf("%d%d", &x, &y)) solve();
  return 0;
}
