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