#include <string>
#include <iostream>

int main() {
  std::string S;
  std::cin >> S;
  bool ans = false;
  for (int i = 0; i + 2 < S.size(); ++i) {
    if (S[i] == '5' && S[i + 1] == '7' && S[i + 2] == '5') {
      ans = true;
    }
  }
  std::cout << (ans ? "YES" : "NO") << std::endl;
  return 0;
}