#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, f = 0, x1, y1, x2, y2;
  cin >> a >> b;
  for (long long i = 1; i < a; i++) {
    long long y = sqrt(1.0 * (a * a - i * i));
    if (y * y == (a * a - i * i)) {
      if ((b * y) % a == 0 && (b * i) % a == 0) {
        if (y == (b * i) / a) continue;
        cout << "YES" << endl;
        cout << "0 0" << endl;
        cout << i << " " << y << endl;
        cout << -((b * y) / a) << " " << ((b * i) / a);
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
