#include using namespace std; typedef int64_t lint; int main() { string s; cin>>s; for(int i=0;i!=s.size()-2;i++){ if(s[i]=='5'&&s[i+1]=='7'&&s[i+2]=='5'){ cout<<"YES"<