#include <bits/stdc++.h>
using namespace std;
long long a, b;
int main() {
  cin >> a >> b;
  for (int i = (int)sqrt(a * a + b * b) + 1; i >= 1; i--) {
    if (i == a) continue;
    long long tmp = sqrt(b * b + a * a - i * i);
    if (tmp == 0) continue;
    if (tmp * tmp == b * b + a * a - i * i) {
      if (1) {
        long long y = a * a * tmp - b * a * i;
        if (y % (a * a + b * b) == 0) {
          y /= (a * a + b * b);
          if (y * b % a == 0) {
            long long x = i + b * y / a;
            printf("YES\n");
            printf("0 0\n");
            cout << i << " " << tmp << endl;
            cout << x << " " << y << endl;
            return 0;
          }
        }
      }
    }
  }
  puts("NO");
}
