#include <stdio.h>
int main()
{
int k, l;
scanf("%d", &k);
while(k > 0){
l = k % 10;
k /= 10;
}
(l == 5 || l == 8) ? printf("YES") : printf("NO");
#include <stdio.h>
int main()
{
int k, l;
scanf("%d", &k);
while(k > 0){
l = k % 10;
k /= 10;
}
(l == 5 || l == 8) ? printf("YES") : printf("NO");
}