#include <bits/stdc++.h>
using namespace std;
const int mmax = 1000006;
const int inf = 0x3fffffff;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int a, b;
  while (cin >> a >> b) {
    if (a > b) {
      int t = a;
      a = b;
      b = t;
    }
    int n = gcd(a, b);
    int xx = -1, yy = -1;
    for (int i = 1; i < n; i++)
      for (int j = i; j < n; j++) {
        if (i * i + j * j == n * n) {
          xx = i, yy = j;
          break;
        }
      }
    if (xx == -1 || n == 1) {
      cout << "NO" << endl;
      continue;
    }
    int ax = a / n;
    int bx = b / n;
    cout << "YES" << endl;
    cout << "0 0" << endl;
    cout << xx * ax << " " << yy * ax << endl;
    cout << yy * bx << " " << -xx * bx << endl;
  }
  return 0;
}
