#include using namespace std; int main(void){ string s,ans; cin>>s; ans = "NO"; if(!s.find("575"))ans="YES"; cout<