#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<pair<int, int> > pf;
  int fn = n;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      int e = 0;
      while (n % i == 0) e++, n /= i;
      pf.emplace_back(i, e);
    }
  }
  if (n > 1) pf.emplace_back(n, 1);
  n = fn;
  if (pf.size() == 1) {
    printf("NO\n");
    return 0;
  }
  int p = pf[0].first, q = pf.back().first;
  int k = 0, rem = n - 1;
  while (rem % p != 0) rem -= q, k++;
  int m = rem / p;
  assert(m * p + k * q == n - 1);
  assert(m > 0 && k > 0);
  printf("YES\n");
  printf("2\n%d %d\n%d %d\n", m, n / p, k, n / q);
  return 0;
}
