#include <bits/stdc++.h>
using namespace std;
long long primes[1000001];
vector<long long> martivebi;
int main() {
  for (long long i = 2; i < 1000001; i++) {
    if (primes[i] == 1) {
      continue;
    } else {
      martivebi.push_back(i);
      for (long long j = i * i; j < 1000001; j += i) {
        primes[j] = 1;
      }
    }
  }
  long long n;
  cin >> n;
  long long gasayofi = 1;
  int gansx = 0;
  long long cur = n;
  for (int i = 0; i < martivebi.size(); i++) {
    long long es = 1;
    if (cur % martivebi[i] == 0) {
      gansx++;
      while (cur % martivebi[i] == 0) {
        cur /= martivebi[i];
        es *= martivebi[i];
      }
    }
    if (cur != 1) {
      gasayofi *= es;
    }
    if (gasayofi * gasayofi > n) {
      break;
    }
  }
  if (cur != 1) {
    gansx++;
  }
  if (gasayofi == n || gansx <= 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    long long gamyofi = n / gasayofi;
    long long darchenilebi = n - 1;
    long long k = 0;
    while (darchenilebi % gasayofi != 0) {
      k++;
      darchenilebi -= gamyofi;
    }
    long long meore = darchenilebi / gasayofi;
    cout << 2 << endl;
    cout << k << " " << gasayofi << endl;
    cout << meore << " " << gamyofi << endl;
  }
  return 0;
}
