#include <bits/stdc++.h>
using namespace std;
int a, b, i, j, d, w, f[2000];
vector<int> x[2000], y[2000];
int main() {
  for (i = 1; i < 1001; i++)
    for (j = 1; j < i; j++) {
      d = i * i - j * j;
      w = sqrt(d);
      if (w * w == d) {
        f[i] = 1;
        x[i].push_back(j);
        y[i].push_back(w);
      }
    }
  cin >> a >> b;
  if (f[a] && f[b])
    for (i = 0; i < x[a].size(); i++)
      for (j = 0; j < x[b].size(); j++)
        if (1.0 * x[a][i] / y[a][i] == 1.0 * x[b][j] / y[b][j]) {
          printf("YES\n0 0\n%d %d\n", x[a][i], y[a][i]);
          if (x[a][i] == y[b][j])
            cout << -y[b][j] << ' ' << x[b][j];
          else
            cout << y[b][j] << ' ' << -x[b][j];
          return 0;
        }
  cout << "NO";
}
