import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long ch = 0; boolean c = true; if (N > (2 << 18)) { c=false; } else { for (long i = 0;; i++) { ch += i; if (ch == N) { ch = i; break; } else if (ch > N) { c = false; break; } } } if (c == true) { System.out.println("YES\n" + ch); } else { System.out.println("NO"); } } }