#include <bits/stdc++.h>
using namespace std;
vector<long long> dv;
int main() {
  long long n, nn;
  cin >> n;
  nn = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      dv.push_back(i);
      while (n % i == 0) {
        n /= i;
      }
    }
  }
  if (n > 1) dv.push_back(n);
  if (dv.size() == 1) {
    cout << "NO" << endl;
    return 0;
  }
  n = nn;
  long long p1 = dv[0], p2 = dv[dv.size() - 1];
  long long b = 1;
  while ((n - 1 - p2 * b) % p1 != 0) b++;
  long long a = (n - 1 - p2 * b) / p1;
  cout << "YES\n2" << endl;
  cout << a << " " << n / p1 << endl;
  cout << b << " " << n / p2 << endl;
  return 0;
}
