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