#include using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++) #define allsort(v) sort(v.begin(),v.end()) #define allsortg(v)sort(v.begin(),v.end(),greater()); const ll mod = 1e9 + 7; const int INF = 1e9; int main() { cin.sync_with_stdio(false); string s; cin >> s; rep(i, s.size()) { if (i!=s.size()-2&&s[i] == '5'&&s[i+1]=='7'&&s[i+2]=='5') { cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }