#include #include int main(){ int i, len, state = 0; char str[101] = {'\0'}; scanf("%s", str); len = strlen(str); for(i = 0; i < len; i++){ if(state == 0){ if(str[i] == '5'){ state = 1; continue; } } if(state == 1){ if(str[i] == '7'){ state = 2; continue; }else{ state = 0; } } if(state == 2){ if(str[i] == '5'){ state = 3; printf("YES\n"); break; }else{ state = 0; } } } if(state != 3) printf("NO\n"); return 0; }