#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int a, b;
pair<int, int> p1[10000], p2[10000];
inline bool isgood(int x) {
  for (int i = 1; i <= 1005; i++) {
    if (i * i == x) return true;
  }
  return false;
}
int main() {
  cin >> a >> b;
  int l1 = a * a;
  int l2 = b * b;
  int h1 = 0, h2 = 0;
  for (int i = 1; i * i <= l1; i++) {
    if (isgood(l1 - i * i)) p1[h1++] = make_pair(i, (int)sqrt(l1 - i * i));
  }
  for (int i = 1; i * i <= l2; i++) {
    if (isgood(l2 - i * i)) p2[h2++] = make_pair(i, (int)sqrt(l2 - i * i));
  }
  pair<int, int> tmp1, tmp2;
  bool ok = false;
  for (int i = 0; i < h1; i++) {
    for (int j = 0; j < h2; j++) {
      if (p1[i].first * p2[j].first == p1[i].second * p2[j].second) {
        if (p1[i].first == p1[i].second && p1[i].first == p2[j].first) continue;
        tmp1 = make_pair(-p1[i].first, p1[i].second);
        tmp2 = p2[j];
        ok = true;
        break;
      } else if (p1[i].first * p2[j].second == p1[i].second * p2[j].first) {
        if (p1[i].first == p1[i].second && p1[i].first == p2[j].first) continue;
        tmp1 = make_pair(-p1[i].second, p1[i].first);
        tmp2 = p2[j];
        ok = true;
        break;
      }
    }
    if (ok) break;
  }
  pair<int, int> cankao = make_pair(0, 0);
  if (!ok) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  if (tmp1.first == tmp2.first) {
    cout << 0 << " " << 0 << endl;
    cout << -tmp1.first << " " << -tmp1.second << endl;
    cout << tmp2.first << " " << tmp2.second;
  } else if (tmp1.second == tmp2.second) {
    cout << 0 << " " << 0 << endl;
    cout << -tmp1.first << " " << -tmp1.second << endl;
    cout << tmp2.first << " " << tmp2.second;
  } else {
    cout << 0 << " " << 0 << endl;
    cout << tmp1.first << " " << tmp1.second << endl;
    cout << tmp2.first << " " << tmp2.second;
  }
  return 0;
}
