#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b;
  cin >> a >> b;
  double x = 1, y;
  int u = 2 * max(a, b);
  for (; x <= u; x++) {
    y = sqrt(a * a - x * x);
    if (x != 0 && y != 0)
      if (y == (int)y) {
        double x2 = -y * b / a, y2 = x * b / a;
        if (x2 != 0 && y2 != 0)
          if (x2 == (int)x2 && y2 == (int)y2)
            if ((x - x2) != 0 && (y - y2) != 0) {
              cout << "YES" << endl;
              cout << 0 << " " << 0 << endl;
              cout << x << " " << y << endl;
              cout << x2 << " " << y2 << endl;
              return 0;
            }
      }
  }
  cout << "NO";
  return 0;
}
