#include <bits/stdc++.h>
using namespace std;
int a;
int b;
vector<pair<int, int> > A;
vector<pair<int, int> > B;
int d(int x1, int y1, int x2, int y2) {
  return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
int cross(int x1, int y1, int x2, int y2, int x3, int y3) {
  return (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1);
}
int main() {
  scanf("%d %d", &a, &b);
  for (int x = -a; x <= a; ++x)
    for (int y = -a; y <= a; ++y)
      if (d(0, 0, x, y) == a * a)
        if (x != 0 and y != 0) A.push_back(make_pair(x, y));
  for (int x = -b; x <= b; ++x)
    for (int y = -b; y <= b; ++y)
      if (d(0, 0, x, y) == b * b)
        if (x != 0 and y != 0) B.push_back(make_pair(x, y));
  for (int i = 0; i < A.size(); ++i)
    for (int j = 0; j < B.size(); ++j)
      if (A[i].first != B[j].first and A[i].second != B[j].second)
        if (abs(cross(0, 0, A[i].first, A[i].second, B[j].first,
                      B[j].second)) == a * b) {
          puts("YES");
          printf("0 0\n");
          printf("%d %d\n", A[i].first, A[i].second);
          printf("%d %d\n", B[j].first, B[j].second);
          return 0;
        }
  puts("NO");
  return 0;
}
