class A{ public static void main(String[] $){ long n=new java.util.Scanner(System.in).nextLong()*2,q=(long)Math.sqrt(n),v=q*(q+1)/2; System.out.println(v==n?("YES\n"+q):"NO"); } }