#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  for (int i = 1; i <= a; i++) {
    for (int j = 1; j <= a; j++) {
      int c2 = (i * i + j * j);
      int c = sqrt(c2);
      if (c == sqrt(c2) && a % c == 0 && b % c == 0) {
        int k = a / c, k2 = b / c;
        if (k * i != k2 * j) {
          cout << "YES" << endl;
          cout << 0 << " " << 0 << endl;
          cout << k * j << " " << k * i << endl;
          cout << -1 * k2 * i << " " << j * k2 << endl;
          return 0;
        } else if (k * j != k2 * i) {
          cout << "YES" << endl;
          cout << 0 << " " << 0 << endl;
          cout << i * k << " " << j * k << endl;
          cout << -1 * j * k2 << " " << i * k2 << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO";
}
