#include <bits/stdc++.h>
using namespace std;
template <class T>
T chmin(T& a, T& b) {
  if (a > b) return a;
}
template <class T>
T chmax(T& a, T& b) {
  if (a < b) return b;
}
const long long INF = 1e18;
const int MOD = 3;
const int N = 7000;
bool v[N];
vector<long long> adj[N];
bool isint(long double x) {
  if (x - 0.0 < 1e-5) {
    return 0;
  }
  if (abs(x - round(x)) < 1e-5) {
    return 1;
  }
  return 0;
}
int main() {
  long double a, b;
  cin >> a >> b;
  for (long double i = 1; i < a; i++) {
    long double deg = acos(i / a);
    if (isint(a * cos(deg)) && isint(b * cos(deg)) && isint(a * sin(deg)) &&
        isint(b * sin(deg))) {
      long long x1 = round(a * cos(deg));
      long long y2 = round(b * cos(deg));
      long long y1 = round(a * sin(deg));
      long long x2 = round(b * sin(deg));
      if (y1 == y2) continue;
      cout << "YES\n";
      cout << "0 0\n";
      cout << x1 << " " << y1 << "\n";
      cout << -x2 << " " << y2 << "\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
