import math n = float(input()) t = (1 + math.sqrt(1 + 8 * n)) / 2 case_1 = int(t) - 1 case_2 = int(t) case_3 = int(t) + 1 if case_1 * (case_1 + 1) == 2 * n: print("YES") print(case_1) elif case_2 * (case_2 + 1) == 2 * n: print("YES") print(case_2) elif case_3 * (case_3 + 1) == 2 * n: print("YES") print(case_3) else: print("NO")