import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); boolean c = true; int x=(int)Math.sqrt(2*N); if(x*(x+1)==2*N){ System.out.println("YES\n" + x); } else { System.out.println("NO"); } } }