function Main(input) {
  var five = (input.match(/5/g) || []).length;
  var seven = (input.match(/7/g) || []).length;

  ( five == 2 && seven == 1)  ? console.log("YES") : console.log("NO");
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));