#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
void upmin(T& a, const U& b) {
  a = min<T>(a, b);
}
template <typename T, typename U>
void upmax(T& a, const U& b) {
  a = max<T>(a, b);
}
template <typename T>
void uniq(T& a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
template <class T>
string to_s(const T& a) {
  ostringstream os;
  os << a;
  return os.str();
}
template <class T>
T to_T(const string& s) {
  istringstream is(s);
  T res;
  is >> res;
  return res;
}
void fast_io() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
bool in_rect(int x, int y, int w, int h) {
  return 0 <= x && x < w && 0 <= y && y < h;
}
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
int main() {
  vector<int> sq;
  for (int i = 0; i < (int)(3000); ++i) sq.push_back(i * i);
  int a, b;
  cin >> a >> b;
  for (int xa = 1; xa < a; ++xa) {
    int ya = a * a - xa * xa;
    if (binary_search((sq).begin(), (sq).end(), ya)) {
      ya = lower_bound((sq).begin(), (sq).end(), ya) - sq.begin();
      if (xa * b % a == 0 && ya * b % a == 0) {
        int xb = -ya * b / a;
        int yb = xa * b / a;
        if (ya != yb) {
          cout << "YES" << endl;
          printf("%d %d\n", 0, 0);
          printf("%d %d\n", xa, ya);
          printf("%d %d\n", xb, yb);
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
}
