#include <stdio.h>
int main(void){
    char s[101];
    scanf( "%s", s );
    for( int i = 0; i <= 98; i++ ){
        if( s[i] == '5' ){
            if( s[i + 1] == '7' ){
                if( s[i + 2] == '5' ){
                    printf( "YES\n" );
                    return 0;
                }
            }
        }
    }
    printf( "NO\n" );
    return 0;
}