import java.util.Scanner; class Main{ public static void main(String[]$){ Scanner s=new Scanner(System.in); long n=s.nextLong(); for(long i=(long)Math.sqrt(n*1.5);true;++i) { long v=i*(i+1)/2; if(v==n) { System.out.println("YES\n"+i); break; }else if(v>n) { System.out.println(v); System.out.println("NO"); break; } } } }