#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, maxn = 128;
const double eps = 1e-8;
inline bool cmp(double a, double b) { return fabs(a - b) < eps; }
inline bool isInt(double d) { return cmp(d, round(d)); }
int main() {
  double a, b;
  cin >> a >> b;
  for (int xa = -round(a); xa <= round(a); ++xa) {
    double tya = sqrt(double(a * a - xa * xa));
    if (!isInt(tya)) {
      continue;
    }
    int ya = round(tya);
    double txb = -(b * ya / a);
    double tyb = (b * xa / a);
    if (!isInt(txb) || !isInt(tyb)) {
      continue;
    }
    int xb = round(txb), yb = round(tyb);
    if (!xa || !xb || !ya || !yb || (xa == xb) || (ya == yb)) continue;
    cout << "YES" << endl;
    cout << 0 << " " << 0 << endl;
    cout << xa << " " << ya << endl;
    cout << xb << " " << yb << endl;
    return 0;
  }
  cout << "NO" << endl;
}
