#include using namespace std; int main() { string s; cin >> s; if (s.size() < 3) { cout << "NO" << endl; return 0; } int f = 0; for (int i = 0; i < s.size() - 2; i++) { if (s.at(i) == '5') { string x = s.substr(i, 3); if (x == "575") f = 1; } } if (f) { cout << "YES" << endl; } else { cout << "NO" << endl; } }