arr = [int(i) for i in input()] arr.sort() if arr[0] + arr[2] == arr[1] * 2: print("YES") else: print("NO")