Ответсообщение недоступно
a = int(input())
b = a // 100
c = a // 10 % 10
d = a % 10
if b > c and d:
e = b
if c > b and d:
e = c
if d > c and b:
e = d
if b < c and d:
r = b
if c < b and d:
r = c
if d < c and b:
r = d
if c < b < d or d < b < c:
v = b
if b < c < d or d < c < b:
v = c
if c < d < b or b < d < c:
v = d
if e + r == v*2:
print('YES')
else:
print('NO')