#include using namespace std; int main(){ string S; cin >> S; int N = S.size(); bool ok = false; for (int i = 0; i <= N - 3; i++){ if (S.substr(i, 3) == "575"){ ok = true; } } if (ok){ cout << "YES" << endl; } else { cout << "NO" << endl; } }