#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n1, long long n2) {
  if (!n1) return n2;
  if (!n2) return n1;
  if (n1 % n2 == 0) return n2;
  return gcd(n2, n1 % n2);
}
long long powmod(long long base, long long exponent) {
  base %= 1000000007;
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % 1000000007;
    base = (base * base) % 1000000007;
    exponent /= 2;
  }
  ans %= 1000000007;
  return ans;
}
vector<int> divisors;
vector<int> a, b;
bool solution_found = false;
vector<int> coeff;
int nn;
void go(int n, int ind) {
  if (ind == -1) return;
  if (solution_found) return;
  if (ind == 0) {
    if (n % divisors[0] == 0) {
      coeff[0] = (n / divisors[0]);
      solution_found = true;
      printf("YES\n");
      int k = 0;
      for (int i = 0; i < coeff.size(); i++)
        if (coeff[i]) {
          k++;
          a.push_back(coeff[i]);
          b.push_back((nn / divisors[i]));
        }
      printf("%d\n", k);
      for (int i = 0; i < k; i++) {
        printf("%d ", a[i]);
        printf("%d\n", b[i]);
      }
      return;
    }
    return;
  }
  for (int i = 0; divisors[ind] * i <= n; i++) {
    coeff[ind] = i;
    go(n - i * divisors[ind], ind - 1);
    if (solution_found) return;
  }
}
int main() {
  clock_t begin = clock();
  ;
  int n, i, j, k;
  scanf("%d", &n);
  nn = n;
  for (i = 2; i * i <= n; i++)
    if (n % i == 0) {
      divisors.push_back(i);
      while (n % i == 0) n /= i;
    }
  if (n != 1 && n != nn) divisors.push_back(n);
  coeff.resize(divisors.size(), 0);
  n = nn;
  go(n - 1, divisors.size() - 1);
  if (!solution_found) printf("NO\n");
  clock_t end = clock();
  double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
  fprintf(stderr, "\nTime elapsed : %.3f seconds\n", elapsed_secs);
  return 0;
  ;
}
