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");
}

var character = "";
process.stdin.on('data', function(char){character += char});
process.stdin.on('end', function(){ Main(character); });
process.on('SIGINT', function() { Main(character); process.exit(0); });