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