#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  int i, j, flag, len;
  int p[1100][2], q[1100][2], pp, qq;
  while (cin >> a >> b) {
    pp = 0;
    qq = 0;
    for (i = 1; i <= 1000; i++)
      for (j = 1; j <= 1000; j++) {
        if (i * i + j * j == a * a) {
          p[pp][0] = i;
          p[pp][1] = j;
          pp++;
        }
        if (i * i + j * j == b * b) {
          q[qq][0] = i;
          q[qq][1] = j;
          qq++;
        }
      }
    flag = 0;
    if (p[0][0] != 0 && q[0][0] != 0)
      for (i = 0; i < pp; i++) {
        for (j = 0; j < qq; j++) {
          len = (p[i][0] + q[j][0]) * (p[i][0] + q[j][0]) +
                (q[j][1] - p[i][1]) * (q[j][1] - p[i][1]);
          if (p[i][1] != q[j][1] && len == (a * a + b * b)) {
            cout << "YES" << endl;
            cout << "0"
                 << " " << p[i][1] << endl;
            cout << p[i][0] << " "
                 << "0" << endl;
            cout << p[i][0] + q[j][0] << " " << q[j][1] << endl;
            flag = 1;
            break;
          }
        }
        if (flag == 1) break;
      }
    if (flag == 0) cout << "NO" << endl;
  }
}
