#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k = n;
  set<int> st;
  for (int i = 2; i <= ceil(sqrt(k)); i++) {
    while (k % i == 0) {
      st.insert(i);
      k /= i;
    }
    if (st.size() == 2) break;
  }
  if (k > 1) st.insert(k);
  if (st.size() < 2) {
    cout << "NO" << endl;
    return 0;
  }
  int a = *st.begin();
  st.erase(st.begin());
  int b = *st.begin();
  int x = n / a;
  int y = n / b;
  int mx = max(a, b);
  int mn = min(a, b);
  int ans1;
  for (int i = 1; i <= mn; i++) {
    if ((i * mx) % mn == mn - 1) {
      n -= i * mx;
      ans1 = i;
      break;
    }
  }
  int ans2 = n / mn;
  cout << "YES" << endl;
  cout << 2 << endl;
  cout << ans1 << " " << min(x, y) << endl;
  cout << ans2 << " " << max(x, y) << endl;
  return 0;
}
