#include <bits/stdc++.h>
using namespace std;
vector<int> primes(int n) {
  vector<int> ret;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) ret.push_back(i);
    while (n % i == 0) n /= i;
  }
  if (n > 1) ret.push_back(n);
  return ret;
}
int n;
int main() {
  cin >> n;
  vector<int> vec = primes(n);
  if (vec.size() == 1) return puts("NO");
  int p2 = vec[0], p1 = vec[1];
  int a1 = 1;
  while ((a1 * p1) % p2 != p2 - 1) a1++;
  int a2 = (n - 1 - a1 * p1) / p2;
  puts("YES");
  puts("2");
  cout << a1 << " " << n / p1 << endl;
  cout << a2 << " " << n / p2 << endl;
}
