#include <bits/stdc++.h>
using namespace std;
long long fun(long long x) {
  long long y = (long long)sqrt(x);
  return y * y == x;
}
int solve() {
  long long a, b;
  cin >> a >> b;
  for (long long int x1_sq = 1; x1_sq < a * a + 1; x1_sq++) {
    long long y1_sq = a * a - x1_sq;
    if (fun(y1_sq)) {
      if ((y1_sq * b * b) % (a * a) == 0 && fun((y1_sq * b * b) / (a * a))) {
        long long x2_sq = (y1_sq * b * b) / (a * a);
        long long y2_sq = b * b - x2_sq;
        if (fun(y2_sq) && y2_sq != y1_sq && x2_sq != 0 && x1_sq != 0 &&
            y1_sq != 0 && y2_sq != 0) {
          cout << "YES\n";
          cout << "0 0\n";
          cout << (long long)sqrt(x1_sq) << " " << (long long)sqrt(y1_sq)
               << "\n";
          cout << -(long long)sqrt(x2_sq) << " " << (long long)sqrt(y2_sq)
               << "\n";
          exit(0);
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
int main() {
  auto start = chrono::high_resolution_clock::now();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test_cases = 1;
  while (test_cases--) solve();
  auto stop = chrono::high_resolution_clock::now();
  auto duration = chrono::duration_cast<chrono::milliseconds>(stop - start);
}
