#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int M = 1000010;
const int MOD = 2008;
const int INF = 0x7fffffff;
const int dir4[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
const int dir8[8][2] = {{-1, 0}, {1, 0},  {0, -1},  {0, 1},
                        {-1, 1}, {1, -1}, {-1, -1}, {1, 1}};
const double eps = 1e-8;
const double PI = acos(-1.0);
inline int sign(double x) { return (x > eps) - (x < -eps); }
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
inline T Min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T Max(T a, T b) {
  return a > b ? a : b;
}
struct Tri {
  int ta, tb;
} tri[2][1010];
int tot[2];
int jud(int a, int sig) {
  int ss = a * a, flag = 0;
  for (int i = 2; i < a && i < 1000; i++) {
    int t = ss - i * i;
    int tt = (int)sqrt(t * 1.0);
    if (tt * tt == t) {
      flag = 1;
      tri[sig][tot[sig]].ta = min(i, tt);
      tri[sig][tot[sig]++].tb = max(i, tt);
    }
  }
  if (!flag) return 0;
  return 1;
}
void deal() {
  int t1, t2, t3, t4;
  for (int i = 0; i < tot[0]; i++) {
    t1 = tri[0][i].ta;
    t2 = tri[0][i].tb;
    for (int j = 0; j < tot[1]; j++) {
      t3 = tri[1][j].ta;
      t4 = tri[1][j].tb;
      if (t1 * t4 == t2 * t3) {
        printf("%s\n", ("YES"));
        printf("%d %d\n", (-t2), (t1));
        printf("%d %d\n", (0), (0));
        printf("%d %d\n", (t3), (t4));
        return;
      }
    }
  }
  printf("%s\n", ("NO"));
}
int main() {
  int a, b;
  while (scanf("%d%d", &(a), &(b)) != EOF) {
    if (a > b) swap(a, b);
    tot[0] = tot[1] = 0;
    if (!jud(a, 0)) {
      printf("%s\n", ("NO"));
      continue;
    }
    if (!jud(b, 1)) {
      printf("%s\n", ("NO"));
      continue;
    }
    deal();
  }
  return 0;
}
