import java.io.*; import java.math.*; import java.util.*; public class Main_yukicoder648 { private static Scanner sc; private static Printer pr; private static void solve() { long n = sc.nextLong(); BigInteger d = BigInteger.ONE.add(BigInteger.valueOf(8).multiply(BigInteger.valueOf(n))); long l = 0; long r = 1_000_000_000_000_000_000L; while (r - l > 1) { long mid = l + (r - l) / 2; BigInteger x2 = BigInteger.valueOf(mid).multiply(BigInteger.valueOf(mid)); if (x2.compareTo(d) >= 0) { // if (data[mid] > value) { r = mid; } else { l = mid; } } if (BigInteger.valueOf(r).multiply(BigInteger.valueOf(r)).compareTo(d) == 0) { pr.println("YES"); pr.println((r - 1) / 2); } else { pr.println("NO"); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }