#include using namespace std; struct Solution { void solve(std::istream& in, std::ostream& out) { string S; string C = "575"; in >> S; bool ans = true; for (int i = 0; i < S.size() - 3; i++) { int j = 0; for (; j < 3; j++) { if (S[i + j] != C[j]) { break; } } ans = j == 3; if (ans)break; } out << (ans ? "YES" : "NO") << '\n'; } }; void solve(std::istream& in, std::ostream& out) { out << std::setprecision(12); Solution solution; solution.solve(in, out); } #include #include int main() { ios_base::sync_with_stdio(0); cin.tie(0); istream& in = cin; ostream& out = cout; solve(in, out); return 0; }