#include <bits/stdc++.h>
using namespace std;
long long a, b;
map<long long, bool> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (long long i = 1; i <= 1000; i++) mp[i * i] = 1;
  cin >> a >> b;
  for (long long i = -1; i > -a; i--) {
    if (mp[a * a - i * i] == 0) continue;
    long long j = sqrt(a * a - i * i);
    for (long long x = 1; x < b; x++) {
      if (mp[b * b - x * x] == 0) continue;
      long long y = sqrt(b * b - x * x);
      if (-i * x == j * y && j != y) {
        cout << "YES\n";
        cout << 0 << " " << 0 << endl;
        cout << i << " " << j << endl;
        cout << x << " " << y;
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
