#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 1e9 + 9, pol = sqrt(maxn);
long long odw(long long a, long long b, long long mod) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = res * a % mod;
    a = a * a % mod;
    b /= 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int m = n;
  long long pom = 1, ktory;
  for (int i = 2; i < pol; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        ktory = i;
        pom *= i;
        n /= i;
      }
      break;
    }
  }
  if (m == pom || pom == 1) {
    cout << "NO";
    return 0;
  }
  long long fi = (ktory - 1) * pom / ktory;
  cout << "YES\n2\n";
  long long jed = odw(n, fi - 1, pom);
  jed = (pom - jed);
  cout << jed << " " << pom << "\n";
  cout << (n * pom - 1 - jed * n) / pom << " " << n << "\n";
}
