#include using namespace std; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } long long lcm(long long x, long long y) { if (x == 0 || y == 0) return 0; return x / gcd(x, y) * y; } int main() { string S; cin >> S; int N = S.size(); for (int i = 0; i < N - 2; i++) { if (S.substr(i, 3) == "575") { cout << "YES" << endl; return 0; } } cout << "NO" << endl; }