#include using namespace std; int main(){ string s; cin >> s; cout << (s.find("575")==string::npos ? "NO" : "YES") << endl; return 0; }