#include <bits/stdc++.h>
using namespace std;
const long double PI = atan(1.0) * 4.0;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
const long long int E = 1e-9;
bool isprime(long long int n) {
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
bool iseql(long double n, long double m) {
  if (abs(n - m) < E)
    return true;
  else
    return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int a, b, g = 0;
  cin >> a >> b;
  for (int i = 1; i < a && g == 0; i++) {
    int j = (int)sqrt(a * a - i * i);
    if ((i * i + j * j) != a * a) continue;
    if (b * j % a != 0) continue;
    if (i * b % a != 0) continue;
    int p = b * j / a;
    int q = b * i / a;
    if (j == q) continue;
    cout << "YES"
         << "\n";
    cout << 0 << " " << 0 << "\n";
    cout << p << " " << q << "\n";
    cout << -i << " " << j << "\n";
    g = 1;
  }
  if (g == 0) cout << "NO";
}
