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