'use strict';
function Main(input) {
  let five = input.toString().split('5').length - 1;
  let seven = input.toString().split('7').length - 1;
  (five == 2 && seven == 1) ? console.log('YES') : console.log('NO');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));