#include using namespace std; const string t = "575"; int main() { string s; cin >> s; bool ok = false; for (int i = 0; i < s.length(); i++) { ok |= (s.substr(i, 3) == t); } cout << (ok ? "YES" : "NO") << endl; return 0; }