// No.558 575検出するやつ
// https://yukicoder.me/problems/no/558
//
#include <iostream>
using namespace std;
string solve(string& S);

int main() {
    string S;
    cin >> S;
    string ans = solve(S);
    cout << ans << endl;
}

string solve(string& S) {
    auto pos = S.find("575");
    if (pos != string::npos)
        return "YES";
    else
        return "NO";
}