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)){ System.out.println("NO"); }else{ for(long i=0;;i++){ ch+=i; if(ch==N){ ch=i; break; }else if(ch>N){ c=false; } } if(c==true){ System.out.println("YES\n"+ch); }else{ System.out.println("NO"); } } } }