function Main(input) {
  var input = input.replace(/\n/g, '').split(/\s+/g).join();
  var five, seven;
  if ((/5/).test(input) && (/7/).test(input)) {
    five = input.match(/5/g).length;
    seven = input.match(/7/g).length;
  }

  if ( five == 2 && seven == 1) {
    console.log("YES");
  } else {
    console.log("NO");
  }
}

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