시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB112769365063.107%

문제

A solid competitive programming team can rack up a lot of prize money. Knowing how strong your team is, you are certain to win a lot of contests, so you had better sit down now and check that everybody will receive the same fair distribution of winnings.

You will participate in multiple contests, and at the end of each one receive a set amount of prize money. You can distribute any amount to each of the three members of your team each time, but by the end everyone must have the same amount of total winnings.

Can you distribute the winnings such that everyone gets an equal amount by the end?

입력

  • One line containing the number of contests, $n$ ($1 \le n \le 10^4$).
  • One line containing the prize purse for each contest, $w_1 \ldots w_n$ ($1 \le w \le 10^5$).

출력

Output yes if the winnings can be distributed equally between three contestants, otherwise no.

예제 입력 1

2
10 3

예제 출력 1

no

예제 입력 2

3
9 8 7

예제 출력 2

yes

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2020 D번

  • 문제를 만든 사람: Robin Lee