5642: ABC181——D - Hachi
[Creator : ]
Description
Given is a digit sequence $S$ consisting of the digits from $1$ through $9$.
Takahashi, the bee, loves multiples of $8$.
He is trying to make a multiple of $8$ by permuting the digit sequence $S$.
Determine whether it is possible.
Takahashi, the bee, loves multiples of $8$.
He is trying to make a multiple of $8$ by permuting the digit sequence $S$.
Determine whether it is possible.
Input
A digit sequence $S$.
Output
If it is possible to make a multiple of $8$ by permuting the digit sequence $S$, print ${Yes}$; otherwise, print ${No}$.
Constraints
$1≤|S|≤2×10^5$
Each character of $S$ is one of the digits from $1$ through $9$.
Each character of $S$ is one of the digits from $1$ through $9$.
Sample 1 Input
1234
Sample 1 Output
Yes
For example, permuting $1234$ into $1432$ results in a multiple of $8$.
Sample 2 Input
1333
Sample 2 Output
No
There is no way to permute $1333$ into a multiple of $8$.
Sample 3 Input
8
Sample 3 Output
Yes