#include <bits/stdc++.h>
using namespace std;
int main() {
  int l1, l2;
  cin >> l1 >> l2;
  bool flag = false;
  int x1 = 0, y1 = 0, x2, y2, x3, y3;
  for (int i = 1; i < l1; ++i) {
    x2 = i;
    int fp = i * i;
    int sp = (l1 * l1) - fp;
    double s = sqrt(sp);
    y2 = INT_MAX;
    if ((int)sqrt(sp) != s)
      continue;
    else
      y2 = (int)s;
    for (int j = 1; j < l2; ++j) {
      x3 = j;
      fp = j * j;
      sp = (l2 * l2) - fp;
      s = sqrt(sp);
      y3 = INT_MAX;
      if ((int)sqrt(sp) != s)
        continue;
      else
        y3 = (int)s;
      if (x2 == x3) continue;
      if ((double)(((double)y2 / (double)i) *
                   ((double)(-1.0 * y3) / (double)j)) == -1.0) {
        flag = true;
        goto exit;
      }
    }
  }
exit:;
  string a[] = {"YES", "NO"};
  if (flag == true) {
    cout << a[0] << '\n';
    cout << x1 << ' ' << y1 << '\n'
         << x2 << ' ' << y2 << '\n'
         << x3 << ' ' << -y3 << '\n';
  } else
    cout << a[1] << '\n';
}
