#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return;
  }
  exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - (a / b) * y;
}
int main() {
  long long n, x, y, t, nn;
  scanf("%I64d", &n);
  nn = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      while (n % i == 0) n /= i;
    }
  }
  if (n != 1) v.push_back(n);
  if (v.size() < 2)
    printf("NO\n");
  else {
    exgcd(v[0], v[1], x, y);
    x *= (nn - 1);
    t = v[1];
    x = (x % t + t) % t;
    if (x == 0) x += t;
    printf("YES\n");
    printf("2\n");
    printf("%I64d %I64d\n", x, nn / v[0]);
    printf("%I64d %I64d\n", (nn - 1 - v[0] * x) / v[1], nn / v[1]);
  }
  return 0;
}
