import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author silviase */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); sheepSleep solver = new sheepSleep(); solver.solve(1, in, out); out.close(); } static class sheepSleep { public void solve(int testNumber, Scanner in, PrintWriter out) { long n = in.nextLong(); long ng = -1; long ok = (int) 1e9; while (Math.abs(ok - ng) > 1) { long mid = (ok + ng) / 2; if (mid * (mid + 1) / 2 >= n) { ok = mid; } else { ng = mid; } } if (ok * (ok + 1) / 2 == n) { out.println("YES"); out.println(ok); } else { out.println("NO"); } } } }