#include using namespace std; int main(){ string s; cin >> s; for(int i = 0; i + 2< s.size(); i++){ bool f = true; for(int j = 0; j < 3; j++) f &= s[i + j] == "575"[j]; if(f){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }