#include using namespace std; #define FOR(i,l,r) for(int i = int(l);i < int(r);i++) template bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; } template bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; } typedef long long ll; int N; string S; int main() { cin >> S; N = S.size(); FOR(i,0,N - 2){ if(S.substr(i,3) == "575"){ puts("YES"); return 0; } } puts("NO"); return 0; }