import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); long n=sc.nextLong(),t; sc.close(); t=(long)Math.sqrt(2*n); if(n==(t*(t+1))/2)System.out.print("YES\n"+t); else System.out.print("NO"); } }