#include using namespace std; int main(){ string s; cin>>s; puts(s.find("575")!=string::npos?"YES":"NO"); }