#abc201a. A - Tiny Arithmetic Sequence

A - Tiny Arithmetic Sequence

Score : 100100 points

问题描述

你已获得一个包含三个数字的序列:A=(A1,A2,A3)A=(A_1,A_2,A_3)

是否可以重新排列AA中的元素以构成一个等差序列?

换句话说,是否有可能重新排列AA中的元素,使得A3A2=A2A1A_3-A_2=A_2-A_1成立?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a sequence of three numbers: A=(A1,A2,A3)A=(A_1,A_2,A_3).

Is it possible to rearrange the elements of AA into an arithmetic sequence?

In other words, is it possible to rearrange the elements of AA so that A3A2=A2A1A_3-A_2=A_2-A_1?

Constrains

  • 1Ai1001 \leq A_i \leq 100
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

A1A_1 A2A_2 A3A_3

Output

If it is possible to rearrange the elements of AA into an arithmetic sequence, print Yes; otherwise, print No.

Sample Input 1

5 1 3

Sample Output 1

Yes

We can rearrange them into an arithmetic sequence by, for example, making it (1,3,5)(1,3,5).

Sample Input 2

1 4 3

Sample Output 2

No

There is no way to rearrange them into an arithmetic sequence.

Sample Input 3

5 5 5

Sample Output 3

Yes

All elements of AA may be equal, or AA may be an arithmetic sequence already.

update @ 2024/3/10 09:12:38