#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int a, b;
vector<pair<int, int> > pa, pb;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> a >> b;
  for (int i = -1000; i <= 1000; ++i) {
    if (i == 0) continue;
    for (int j = 1; j <= 1000; ++j) {
      if (i * i + j * j == a * a) pa.push_back(make_pair(j, i));
      if (i * i + j * j == b * b) pb.push_back(make_pair(j, i));
    }
  }
  for (int i = 0; i < pa.size(); ++i)
    for (int j = 0; j < pb.size(); ++j)
      if (pa[i].first * pb[j].first + pa[i].second * pb[j].second == 0 &&
          pa[i].first != pb[j].first) {
        cout << "YES\n0 0\n";
        cout << pa[i].first << " " << pa[i].second << "\n";
        cout << pb[j].first << " " << pb[j].second;
        return 0;
      }
  cout << "NO";
}
