#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { bool ans = false; string S; cin >> S; if ( S.length() < 3 ) { cout << "NO" << endl; return 0; } for ( int i = 0; i < S.length()-2; i++ ) { if ( S.substr( i, 3 ) == "575" ) { ans = true; break; } } cout << ( ans ? "YES" : "NO" ) << endl; return 0; }