import java.util.Scanner; public class No648 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); if((Math.sqrt(8 * n + 1) - 1) % 2 == 0) { System.out.println("YES"); System.out.println(((long)Math.sqrt(8 * n + 1) - 1) / 2); }else { System.out.println("NO"); } } }