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