#include <bits/stdc++.h>
using namespace std;
int rt[1000005];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b;
  cin >> a >> b;
  memset(rt, 0, sizeof(rt));
  for (int i = 1; i <= 1000; i++) rt[i * i] = i;
  vector<pair<int, int> > posA, posB;
  for (int i = 1; i < a; i++) {
    if (rt[a * a - i * i]) {
      posA.push_back({-i, rt[a * a - i * i]});
      posA.push_back({-rt[a * a - i * i], i});
    }
  }
  for (int i = 1; i < b; i++) {
    if (rt[b * b - i * i]) {
      posB.push_back({i, rt[b * b - i * i]});
      posB.push_back({rt[b * b - i * i], i});
    }
  }
  for (pair<int, int> A : posA) {
    for (pair<int, int> B : posB) {
      if (A.second == B.second) continue;
      if (A.first * B.first + A.second * B.second == 0) {
        cout << "YES\n";
        cout << A.first << " " << A.second << "\n";
        cout << "0 0\n";
        cout << B.first << " " << B.second << "\n";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
