#include <bits/stdc++.h>
using namespace std;
int extgcd(int a, int b, int &x, int &y) {
  int d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1, y = 0;
  }
  return d;
}
int main() {
  int n;
  cin >> n;
  vector<int> prime;
  int m = n;
  for (int i = 2; i * i <= n; i++) {
    if (m % i == 0) {
      prime.emplace_back(i);
      while (m % i == 0) {
        m /= i;
      }
    }
  }
  if (m != 1) prime.emplace_back(m);
  if (prime.size() < 2) {
    cout << "NO\n";
    return 0;
  }
  int a = prime[0], b = prime[1], x, y;
  extgcd(a, b, x, y);
  x *= -1, y *= -1;
  if (x < 0)
    x += n / a;
  else if (y < 0)
    y += n / b;
  cerr << x << ' ' << y << '\n';
  cout << "YES\n";
  cout << "2\n";
  cout << x << ' ' << n / a << '\n';
  cout << y << ' ' << n / b << '\n';
  return 0;
}
