#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
int p2(int x) { return x * x; }
void p(int g, int l) {
  int i, j, flag = 0;
  int t;
  if (gcd(g, l) == 1)
    cout << "NO";
  else {
    t = l / gcd(g, l);
    l = gcd(g, l);
    int f = g / gcd(g, l);
    for (i = 1; i < l; i++) {
      if (p2(floor(sqrt((double)p2(l) - p2(i)))) + p2(i) == p2(l)) {
        j = sqrt((double)p2(l) - p2(i));
        if (i != j) {
          flag = 1;
          break;
        }
      }
    }
    if (flag) {
      long long x2 = 1000000000, y2 = 1000000000;
      long long x0 = x2 - f * i, y0 = y2 - f * j;
      long long x1 = x0 - t * j, y1 = y0 + t * i;
      cout << "YES\n"
           << x2 << " " << y2 << "\n"
           << x0 << " " << y0 << "\n"
           << x1 << " " << y1;
    } else
      cout << "NO";
  }
}
int main() {
  int a, b, g, l;
  cin >> a >> b;
  g = max(a, b);
  l = min(a, b);
  p(g, l);
}
