n = int(input()) ans = int((-1+(1+8*n)**0.5)//2) if ans == n: print('YES') print(ans) else: print('NO')