886A.md (1456B)
1 Source: https://codeforces.com/problemset/problem/886/A 2 3 A. ACM ICPC 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 standard input 16 17 output 18 19 standard output 20 21 In a small but very proud high school it was decided to win ACM ICPC. This goal requires to compose as many teams of three as possible, but since there were only 6 students who wished to participate, the decision was to build exactly two teams. 22 23 After practice competition, participant number *i* got a score of *a**i*. Team score is defined as sum of scores of its participants. High school management is interested if it's possible to build two teams with equal scores. Your task is to answer that question. 24 25 Input 26 27 The single line contains six integers *a*1, ..., *a*6 (0 ≤ *a**i* ≤ 1000) — scores of the participants 28 29 Output 30 31 Print "YES" (quotes for clarity), if it is possible to build teams with equal score, and "NO" otherwise. 32 33 You can print each character either upper- or lowercase ("YeS" and "yes" are valid when the answer is "YES"). 34 35 Examples 36 37 Input 38 39 ``` 40 1 3 2 1 2 1 41 ``` 42 43 Output 44 45 ``` 46 YES 47 ``` 48 49 Input 50 51 ``` 52 1 1 1 1 1 99 53 ``` 54 55 Output 56 57 ``` 58 NO 59 ``` 60 61 Note 62 63 In the first sample, first team can be composed of 1st, 2nd and 6th participant, second — of 3rd, 4th and 5th: team scores are 1 + 3 + 1 = 2 + 1 + 2 = 5. 64 65 In the second sample, score of participant number 6 is too high: his team score will be definitely greater.