#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  for (int i = 1; i < a; i++) {
    double t = sqrt(a * a - i * i);
    if (t - (int)t == 0) {
      double ta = -1 * (b * t) / a;
      double tb = (b * i) / a;
      if (ta - (int)ta == 0 && tb - (int)tb == 0 && tb != t) {
        printf("YES\n0 0\n%d %.0lf\n%.0lf %.0lf\n", i, t, ta, tb);
        return 0;
      }
    }
  }
  printf("NO\n");
  return 0;
}
