#include #include #include #include #include using namespace std; int main(void) { int count = 0; string str; cin >> str; for (int i = 0; i < str.size(); i++) { switch (count) { case 0: if (str[i] == '5') count++; else count = 0; break; case 1: if (str[i] == '7') count++; else count = 0; break; case 2: if (str[i] == '5') { cout << "YES" << endl; return 0; } else count = 0; break; } } cout << "NO" << endl; return 0; }