题目描述
Problem Description
A certain pianist wants to play the piano with his feet and has prepared a special large piano. This piano has $10^{100}$ keys, each assigned a note in the sequence: Do, Re, Mi, Fa, So, La, Si, Do, Re, ... respectively. Pressing a key once will produce the assigned note once.
The ideal performance the pianist is thinking of is as follows:
- Play the notes Do to Si exactly $C_1$ to $C_7$ times each. It's okay to press any key for the same note.
- Immediately after pressing a key, only the adjacent keys can be pressed next. That is, after pressing the $i$-th key, only the $i-1$ or $i+1$ key can be pressed.
- Start with the note Do and end with the note Do. It's okay to start and end on any key for the note Do, and they do not need to be the same key.
Determine whether the pianist can perform the ideal performance.
Input Format
The input is given from the standard input in the following format:
$C_1$ $C_2$ $C_3$ $C_4$ $C_5$ $C_6$ $C_7$
- The first line contains 7 integers $C_1$ to $C_7$ $(0 ≦ C_1$ to $C_7 ≦ 10^{10})$ separated by spaces. These represent the number of times the pianist wants to play the notes Do, Re, Mi, Fa, So, La, Si respectively. It is guaranteed that the sum of $C_1$ to $C_7$ is at least 1.
Output Format
If the pianist can perform the ideal performance, output YES; otherwise, output NO. End the output with a newline.
Sample Input and Output
Sample Input #1
2 1 1 1 1 1 1
Sample Output #1
YES
Sample Input #2
1 1 1 1 1 1 1
Sample Output #2
NO
Sample Input #3
3 1 0 10000000000 10000000000 0 1
Sample Output #3
NO
Sample Input #4
1 0 0 0 0 0 0
Sample Output #4
YES
Notes/Hints
Sample Explanation 1
The ideal performance can be achieved by pressing the keys in the order: Do, Re, Mi, Fa, So, La, Si, Do.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分